Observable.java

1
/**
2
 * Copyright 2014 Netflix, Inc.
3
 * 
4
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5
 * compliance with the License. You may obtain a copy of the License at
6
 * 
7
 * http://www.apache.org/licenses/LICENSE-2.0
8
 * 
9
 * Unless required by applicable law or agreed to in writing, software distributed under the License is
10
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11
 * the License for the specific language governing permissions and limitations under the License.
12
 */
13
package rx;
14
15
import java.util.*;
16
import java.util.concurrent.*;
17
18
import rx.annotations.*;
19
import rx.exceptions.*;
20
import rx.functions.*;
21
import rx.internal.operators.*;
22
import rx.internal.producers.SingleProducer;
23
import rx.internal.util.*;
24
import rx.observables.*;
25
import rx.observers.SafeSubscriber;
26
import rx.plugins.*;
27
import rx.schedulers.*;
28
import rx.subscriptions.Subscriptions;
29
30
/**
31
 * The Observable class that implements the Reactive Pattern.
32
 * <p>
33
 * This class provides methods for subscribing to the Observable as well as delegate methods to the various
34
 * Observers.
35
 * <p>
36
 * The documentation for this class makes use of marble diagrams. The following legend explains these diagrams:
37
 * <p>
38
 * <img width="640" height="301" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/legend.png" alt="">
39
 * <p>
40
 * For more information see the <a href="http://reactivex.io/documentation/observable.html">ReactiveX
41
 * documentation</a>.
42
 * 
43
 * @param <T>
44
 *            the type of the items emitted by the Observable
45
 */
46
public class Observable<T> {
47
48
    final OnSubscribe<T> onSubscribe;
49
50
    /**
51
     * Creates an Observable with a Function to execute when it is subscribed to.
52
     * <p>
53
     * <em>Note:</em> Use {@link #create(OnSubscribe)} to create an Observable, instead of this constructor,
54
     * unless you specifically have a need for inheritance.
55
     * 
56
     * @param f
57
     *            {@link OnSubscribe} to be executed when {@link #subscribe(Subscriber)} is called
58
     */
59
    protected Observable(OnSubscribe<T> f) {
60
        this.onSubscribe = f;
61
    }
62
63
    static final RxJavaObservableExecutionHook hook = RxJavaPlugins.getInstance().getObservableExecutionHook();
64
65
    /**
66
     * Returns an Observable that will execute the specified function when a {@link Subscriber} subscribes to
67
     * it.
68
     * <p>
69
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/create.png" alt="">
70
     * <p>
71
     * Write the function you pass to {@code create} so that it behaves as an Observable: It should invoke the
72
     * Subscriber's {@link Subscriber#onNext onNext}, {@link Subscriber#onError onError}, and
73
     * {@link Subscriber#onCompleted onCompleted} methods appropriately.
74
     * <p>
75
     * A well-formed Observable must invoke either the Subscriber's {@code onCompleted} method exactly once or
76
     * its {@code onError} method exactly once.
77
     * <p>
78
     * See <a href="http://go.microsoft.com/fwlink/?LinkID=205219">Rx Design Guidelines (PDF)</a> for detailed
79
     * information.
80
     * <dl>
81
     *  <dt><b>Scheduler:</b></dt>
82
     *  <dd>{@code create} does not operate by default on a particular {@link Scheduler}.</dd>
83
     * </dl>
84
     * 
85
     * @param <T>
86
     *            the type of the items that this Observable emits
87
     * @param f
88
     *            a function that accepts an {@code Subscriber<T>}, and invokes its {@code onNext},
89
     *            {@code onError}, and {@code onCompleted} methods as appropriate
90
     * @return an Observable that, when a {@link Subscriber} subscribes to it, will execute the specified
91
     *         function
92
     * @see <a href="http://reactivex.io/documentation/operators/create.html">ReactiveX operators documentation: Create</a>
93
     */
94
    public static <T> Observable<T> create(OnSubscribe<T> f) {
95 1 1. create : mutated return of Object value for rx/Observable::create to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return new Observable<T>(hook.onCreate(f));
96
    }
97
98
    /**
99
     * Returns an Observable that respects the back-pressure semantics. When the returned Observable is 
100
     * subscribed to it will initiate the given {@link SyncOnSubscribe}'s life cycle for 
101
     * generating events. 
102
     * 
103
     * <p><b>Note:</b> the {@code SyncOnSubscribe} provides a generic way to fulfill data by iterating 
104
     * over a (potentially stateful) function (e.g. reading data off of a channel, a parser, ). If your 
105
     * data comes directly from an asyrchronous/potentially concurrent source then consider using the 
106
     * {@link Observable#create(AsyncOnSubscribe) asynchronous overload}.
107
     * 
108
     * <p>
109
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/create-sync.png" alt="">
110
     * <p>
111
     * See <a href="http://go.microsoft.com/fwlink/?LinkID=205219">Rx Design Guidelines (PDF)</a> for detailed
112
     * information.
113
     * <dl>
114
     *  <dt><b>Scheduler:</b></dt>
115
     *  <dd>{@code create} does not operate by default on a particular {@link Scheduler}.</dd>
116
     * </dl>
117
     * 
118
     * @param <T>
119
     *            the type of the items that this Observable emits
120
     * @param syncOnSubscribe
121
     *            an implementation of {@link SyncOnSubscribe}. There are many static creation methods 
122
     *            on the class for convenience.  
123
     * @return an Observable that, when a {@link Subscriber} subscribes to it, will execute the specified
124
     *         function
125
     * @see {@link SyncOnSubscribe} {@code static create*} methods
126
     * @see <a href="http://reactivex.io/documentation/operators/create.html">ReactiveX operators documentation: Create</a>
127
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
128
     */
129
    @Experimental
130
    public static <S, T> Observable<T> create(SyncOnSubscribe<S, T> syncOnSubscribe) {
131 1 1. create : mutated return of Object value for rx/Observable::create to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return new Observable<T>(hook.onCreate(syncOnSubscribe));
132
    }
133
134
    /**
135
     * Returns an Observable that respects the back-pressure semantics. When the returned Observable is 
136
     * subscribed to it will initiate the given {@link AsyncOnSubscribe}'s life cycle for 
137
     * generating events. 
138
     * 
139
     * <p><b>Note:</b> the {@code AsyncOnSubscribe} is useful for observable sources of data that are 
140
     * necessarily asynchronous (RPC, external services, etc). Typically most use cases can be solved 
141
     * with the {@link Observable#create(SyncOnSubscribe) synchronous overload}.
142
     * 
143
     * <p>
144
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/create-async.png" alt="">
145
     * <p>
146
     * See <a href="http://go.microsoft.com/fwlink/?LinkID=205219">Rx Design Guidelines (PDF)</a> for detailed
147
     * information.
148
     * <dl>
149
     *  <dt><b>Scheduler:</b></dt>
150
     *  <dd>{@code create} does not operate by default on a particular {@link Scheduler}.</dd>
151
     * </dl>
152
     * 
153
     * @param <T>
154
     *            the type of the items that this Observable emits
155
     * @param asyncOnSubscribe
156
     *            an implementation of {@link AsyncOnSubscribe}. There are many static creation methods 
157
     *            on the class for convenience. 
158
     * @return an Observable that, when a {@link Subscriber} subscribes to it, will execute the specified
159
     *         function
160
     * @see {@link AsyncOnSubscribe AsyncOnSubscribe} {@code static create*} methods
161
     * @see <a href="http://reactivex.io/documentation/operators/create.html">ReactiveX operators documentation: Create</a>
162
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
163
     */
164
    @Experimental
165
    public static <S, T> Observable<T> create(AsyncOnSubscribe<S, T> asyncOnSubscribe) {
166 1 1. create : mutated return of Object value for rx/Observable::create to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return new Observable<T>(hook.onCreate(asyncOnSubscribe));
167
    }
168
169
    /**
170
     * Invoked when Observable.subscribe is called.
171
     */
172
    public interface OnSubscribe<T> extends Action1<Subscriber<? super T>> {
173
        // cover for generics insanity
174
    }
175
176
    /**
177
     * Operator function for lifting into an Observable.
178
     */
179
    public interface Operator<R, T> extends Func1<Subscriber<? super R>, Subscriber<? super T>> {
180
        // cover for generics insanity
181
    }
182
183
    /**
184
     * Passes all emitted values from this Observable to the provided conversion function to be collected and
185
     * returned as a single value. Note that it is legal for a conversion function to return an Observable
186
     * (enabling chaining). 
187
     * 
188
     * @param conversion a function that converts from this {@code Observable<T>} to an {@code R}
189
     * @return an instance of R created by the provided conversion function
190
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
191
     */
192
    @Experimental
193
    public <R> R extend(Func1<? super OnSubscribe<T>, ? extends R> conversion) {
194 1 1. extend : mutated return of Object value for rx/Observable::extend to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return conversion.call(new OnSubscribe<T>() {
195
            @Override
196
            public void call(Subscriber<? super T> subscriber) {
197 1 1. call : removed call to rx/Subscriber::add → SURVIVED
                subscriber.add(Observable.subscribe(subscriber, Observable.this));
198
            }});
199
    }
200
    
201
    /**
202
     * Lifts a function to the current Observable and returns a new Observable that when subscribed to will pass
203
     * the values of the current Observable through the Operator function.
204
     * <p>
205
     * In other words, this allows chaining Observers together on an Observable for acting on the values within
206
     * the Observable.
207
     * <p> {@code
208
     * observable.map(...).filter(...).take(5).lift(new OperatorA()).lift(new OperatorB(...)).subscribe()
209
     * }
210
     * <p>
211
     * If the operator you are creating is designed to act on the individual items emitted by a source
212
     * Observable, use {@code lift}. If your operator is designed to transform the source Observable as a whole
213
     * (for instance, by applying a particular set of existing RxJava operators to it) use {@link #compose}.
214
     * <dl>
215
     *  <dt><b>Scheduler:</b></dt>
216
     *  <dd>{@code lift} does not operate by default on a particular {@link Scheduler}.</dd>
217
     * </dl>
218
     * 
219
     * @param operator the Operator that implements the Observable-operating function to be applied to the source
220
     *             Observable
221
     * @return an Observable that is the result of applying the lifted Operator to the source Observable
222
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Implementing-Your-Own-Operators">RxJava wiki: Implementing Your Own Operators</a>
223
     */
224
    public final <R> Observable<R> lift(final Operator<? extends R, ? super T> operator) {
225 1 1. lift : mutated return of Object value for rx/Observable::lift to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return new Observable<R>(new OnSubscribe<R>() {
226
            @Override
227
            public void call(Subscriber<? super R> o) {
228
                try {
229
                    Subscriber<? super T> st = hook.onLift(operator).call(o);
230
                    try {
231
                        // new Subscriber created and being subscribed with so 'onStart' it
232 1 1. call : removed call to rx/Subscriber::onStart → KILLED
                        st.onStart();
233 1 1. call : removed call to rx/Observable$OnSubscribe::call → KILLED
                        onSubscribe.call(st);
234
                    } catch (Throwable e) {
235
                        // localized capture of errors rather than it skipping all operators 
236
                        // and ending up in the try/catch of the subscribe method which then
237
                        // prevents onErrorResumeNext and other similar approaches to error handling
238 1 1. call : removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED
                        Exceptions.throwIfFatal(e);
239 1 1. call : removed call to rx/Subscriber::onError → TIMED_OUT
                        st.onError(e);
240
                    }
241
                } catch (Throwable e) {
242 1 1. call : removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED
                    Exceptions.throwIfFatal(e);
243
                    // if the lift function failed all we can do is pass the error to the final Subscriber
244
                    // as we don't have the operator available to us
245 1 1. call : removed call to rx/Subscriber::onError → KILLED
                    o.onError(e);
246
                }
247
            }
248
        });
249
    }
250
    
251
    /**
252
     * Transform an Observable by applying a particular Transformer function to it.
253
     * <p>
254
     * This method operates on the Observable itself whereas {@link #lift} operates on the Observable's
255
     * Subscribers or Observers.
256
     * <p>
257
     * If the operator you are creating is designed to act on the individual items emitted by a source
258
     * Observable, use {@link #lift}. If your operator is designed to transform the source Observable as a whole
259
     * (for instance, by applying a particular set of existing RxJava operators to it) use {@code compose}.
260
     * <dl>
261
     *  <dt><b>Scheduler:</b></dt>
262
     *  <dd>{@code compose} does not operate by default on a particular {@link Scheduler}.</dd>
263
     * </dl>
264
     * 
265
     * @param transformer implements the function that transforms the source Observable
266
     * @return the source Observable, transformed by the transformer function
267
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Implementing-Your-Own-Operators">RxJava wiki: Implementing Your Own Operators</a>
268
     */
269
    @SuppressWarnings("unchecked")
270
    public <R> Observable<R> compose(Transformer<? super T, ? extends R> transformer) {
271 1 1. compose : mutated return of Object value for rx/Observable::compose to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return ((Transformer<T, R>) transformer).call(this);
272
    }
273
274
    /**
275
     * Transformer function used by {@link #compose}.
276
     * @warn more complete description needed
277
     */
278
    public interface Transformer<T, R> extends Func1<Observable<T>, Observable<R>> {
279
        // cover for generics insanity
280
    }
281
282
    /**
283
     * Returns a Single that emits the single item emitted by the source Observable, if that Observable
284
     * emits only a single item. If the source Observable emits more than one item or no items, notify of an
285
     * {@code IllegalArgumentException} or {@code NoSuchElementException} respectively.
286
     * <p>
287
     * <img width="640" height="295" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.toSingle.png" alt="">
288
     * <dl>
289
     *  <dt><b>Scheduler:</b></dt>
290
     *  <dd>{@code toSingle} does not operate by default on a particular {@link Scheduler}.</dd>
291
     * </dl>
292
     *
293
     * @return a Single that emits the single item emitted by the source Observable
294
     * @throws IllegalArgumentException
295
     *             if the source observable emits more than one item
296
     * @throws NoSuchElementException
297
     *             if the source observable emits no items
298
     * @see <a href="http://reactivex.io/documentation/single.html">ReactiveX documentation: Single</a>
299
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
300
     */
301
    @Beta
302
    public Single<T> toSingle() {
303 1 1. toSingle : mutated return of Object value for rx/Observable::toSingle to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return new Single<T>(OnSubscribeSingle.create(this));
304
    }
305
306
    /**
307
     * Returns a Completable that discards all onNext emissions (similar to
308
     * {@code ignoreAllElements()}) and calls onCompleted when this source observable calls
309
     * onCompleted. Error terminal events are propagated.
310
     * <p>
311
     * <img width="640" height="295" src=
312
     * "https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.toCompletable.png"
313
     * alt="">
314
     * <dl>
315
     * <dt><b>Scheduler:</b></dt>
316
     * <dd>{@code toCompletable} does not operate by default on a particular {@link Scheduler}.</dd>
317
     * </dl>
318
     *
319
     * @return a Completable that calls onCompleted on it's subscriber when the source Observable
320
     *         calls onCompleted
321
     * @see <a href="http://reactivex.io/documentation/completable.html">ReactiveX documentation:
322
     *      Completable</a>
323
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical
324
     *        with the release number)
325
     */
326
    @Experimental
327
    public Completable toCompletable() {
328 1 1. toCompletable : mutated return of Object value for rx/Observable::toCompletable to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return Completable.fromObservable(this);
329
    }
330
    
331
332
    /* *********************************************************************************************************
333
     * Operators Below Here
334
     * *********************************************************************************************************
335
     */
336
337
    /**
338
     * Mirrors the one Observable in an Iterable of several Observables that first either emits an item or sends
339
     * a termination notification.
340
     * <p>
341
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
342
     * <dl>
343
     *  <dt><b>Scheduler:</b></dt>
344
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
345
     * </dl>
346
     * 
347
     * @param sources
348
     *            an Iterable of Observable sources competing to react first
349
     * @return an Observable that emits the same sequence as whichever of the source Observables first
350
     *         emitted an item or sent a termination notification
351
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
352
     */
353
    public static <T> Observable<T> amb(Iterable<? extends Observable<? extends T>> sources) {
354 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(sources));
355
    }
356
357
    /**
358
     * Given two Observables, mirrors the one that first either emits an item or sends a termination
359
     * notification.
360
     * <p>
361
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
362
     * <dl>
363
     *  <dt><b>Scheduler:</b></dt>
364
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
365
     * </dl>
366
     * 
367
     * @param o1
368
     *            an Observable competing to react first
369
     * @param o2
370
     *            an Observable competing to react first
371
     * @return an Observable that emits the same sequence as whichever of the source Observables first
372
     *         emitted an item or sent a termination notification
373
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
374
     */
375
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2) {
376 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(OnSubscribeAmb.amb(o1, o2));
377
    }
378
379
    /**
380
     * Given three Observables, mirrors the one that first either emits an item or sends a termination
381
     * notification.
382
     * <p>
383
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
384
     * <dl>
385
     *  <dt><b>Scheduler:</b></dt>
386
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
387
     * </dl>
388
     * 
389
     * @param o1
390
     *            an Observable competing to react first
391
     * @param o2
392
     *            an Observable competing to react first
393
     * @param o3
394
     *            an Observable competing to react first
395
     * @return an Observable that emits the same sequence as whichever of the source Observables first
396
     *         emitted an item or sent a termination notification
397
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
398
     */
399
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3) {
400 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(o1, o2, o3));
401
    }
402
403
    /**
404
     * Given four Observables, mirrors the one that first either emits an item or sends a termination
405
     * notification.
406
     * <p>
407
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
408
     * <dl>
409
     *  <dt><b>Scheduler:</b></dt>
410
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
411
     * </dl>
412
     * 
413
     * @param o1
414
     *            an Observable competing to react first
415
     * @param o2
416
     *            an Observable competing to react first
417
     * @param o3
418
     *            an Observable competing to react first
419
     * @param o4
420
     *            an Observable competing to react first
421
     * @return an Observable that emits the same sequence as whichever of the source Observables first
422
     *         emitted an item or sent a termination notification
423
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
424
     */
425
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4) {
426 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(o1, o2, o3, o4));
427
    }
428
429
    /**
430
     * Given five Observables, mirrors the one that first either emits an item or sends a termination
431
     * notification.
432
     * <p>
433
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
434
     * <dl>
435
     *  <dt><b>Scheduler:</b></dt>
436
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
437
     * </dl>
438
     *
439
     * @param o1
440
     *            an Observable competing to react first
441
     * @param o2
442
     *            an Observable competing to react first
443
     * @param o3
444
     *            an Observable competing to react first
445
     * @param o4
446
     *            an Observable competing to react first
447
     * @param o5
448
     *            an Observable competing to react first
449
     * @return an Observable that emits the same sequence as whichever of the source Observables first
450
     *         emitted an item or sent a termination notification
451
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
452
     */
453
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5) {
454 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(o1, o2, o3, o4, o5));
455
    }
456
457
    /**
458
     * Given six Observables, mirrors the one that first either emits an item or sends a termination
459
     * notification.
460
     * <p>
461
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
462
     * <dl>
463
     *  <dt><b>Scheduler:</b></dt>
464
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
465
     * </dl>
466
     * 
467
     * @param o1
468
     *            an Observable competing to react first
469
     * @param o2
470
     *            an Observable competing to react first
471
     * @param o3
472
     *            an Observable competing to react first
473
     * @param o4
474
     *            an Observable competing to react first
475
     * @param o5
476
     *            an Observable competing to react first
477
     * @param o6
478
     *            an Observable competing to react first
479
     * @return an Observable that emits the same sequence as whichever of the source Observables first
480
     *         emitted an item or sent a termination notification
481
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
482
     */
483
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6) {
484 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(o1, o2, o3, o4, o5, o6));
485
    }
486
487
    /**
488
     * Given seven Observables, mirrors the one that first either emits an item or sends a termination
489
     * notification.
490
     * <p>
491
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
492
     * <dl>
493
     *  <dt><b>Scheduler:</b></dt>
494
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
495
     * </dl>
496
     *
497
     * @param o1
498
     *            an Observable competing to react first
499
     * @param o2
500
     *            an Observable competing to react first
501
     * @param o3
502
     *            an Observable competing to react first
503
     * @param o4
504
     *            an Observable competing to react first
505
     * @param o5
506
     *            an Observable competing to react first
507
     * @param o6
508
     *            an Observable competing to react first
509
     * @param o7
510
     *            an Observable competing to react first
511
     * @return an Observable that emits the same sequence as whichever of the source Observables first
512
     *         emitted an item or sent a termination notification
513
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
514
     */
515
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6, Observable<? extends T> o7) {
516 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(o1, o2, o3, o4, o5, o6, o7));
517
    }
518
519
    /**
520
     * Given eight Observables, mirrors the one that first either emits an item or sends a termination
521
     * notification.
522
     * <p>
523
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
524
     * <dl>
525
     *  <dt><b>Scheduler:</b></dt>
526
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
527
     * </dl>
528
     *
529
     * @param o1
530
     *            an Observable competing to react first
531
     * @param o2
532
     *            an Observable competing to react first
533
     * @param o3
534
     *            an Observable competing to react first
535
     * @param o4
536
     *            an Observable competing to react first
537
     * @param o5
538
     *            an Observable competing to react first
539
     * @param o6
540
     *            an Observable competing to react first
541
     * @param o7
542
     *            an Observable competing to react first
543
     * @param o8
544
     *            an observable competing to react first
545
     * @return an Observable that emits the same sequence as whichever of the source Observables first
546
     *         emitted an item or sent a termination notification
547
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
548
     */
549
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6, Observable<? extends T> o7, Observable<? extends T> o8) {
550 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(o1, o2, o3, o4, o5, o6, o7, o8));
551
    }
552
553
    /**
554
     * Given nine Observables, mirrors the one that first either emits an item or sends a termination
555
     * notification.
556
     * <p>
557
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
558
     * <dl>
559
     *  <dt><b>Scheduler:</b></dt>
560
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
561
     * </dl>
562
     * 
563
     * @param o1
564
     *            an Observable competing to react first
565
     * @param o2
566
     *            an Observable competing to react first
567
     * @param o3
568
     *            an Observable competing to react first
569
     * @param o4
570
     *            an Observable competing to react first
571
     * @param o5
572
     *            an Observable competing to react first
573
     * @param o6
574
     *            an Observable competing to react first
575
     * @param o7
576
     *            an Observable competing to react first
577
     * @param o8
578
     *            an Observable competing to react first
579
     * @param o9
580
     *            an Observable competing to react first
581
     * @return an Observable that emits the same sequence as whichever of the source Observables first
582
     *         emitted an item or sent a termination notification
583
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
584
     */
585
    public static <T> Observable<T> amb(Observable<? extends T> o1, Observable<? extends T> o2, Observable<? extends T> o3, Observable<? extends T> o4, Observable<? extends T> o5, Observable<? extends T> o6, Observable<? extends T> o7, Observable<? extends T> o8, Observable<? extends T> o9) {
586 1 1. amb : mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeAmb.amb(o1, o2, o3, o4, o5, o6, o7, o8, o9));
587
    }
588
589
    /**
590
     * Combines two source Observables by emitting an item that aggregates the latest values of each of the
591
     * source Observables each time an item is received from either of the source Observables, where this
592
     * aggregation is defined by a specified function.
593
     * <p>
594
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
595
     * <dl>
596
     *  <dt><b>Scheduler:</b></dt>
597
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
598
     * </dl>
599
     *
600
     * @param o1
601
     *            the first source Observable
602
     * @param o2
603
     *            the second source Observable
604
     * @param combineFunction
605
     *            the aggregation function used to combine the items emitted by the source Observables
606
     * @return an Observable that emits items that are the result of combining the items emitted by the source
607
     *         Observables by means of the given aggregation function
608
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
609
     */
610
    @SuppressWarnings("unchecked")
611
    public static <T1, T2, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Func2<? super T1, ? super T2, ? extends R> combineFunction) {
612 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2), Functions.fromFunc(combineFunction));
613
    }
614
615
    /**
616
     * Combines three source Observables by emitting an item that aggregates the latest values of each of the
617
     * source Observables each time an item is received from any of the source Observables, where this
618
     * aggregation is defined by a specified function.
619
     * <p>
620
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
621
     * <dl>
622
     *  <dt><b>Scheduler:</b></dt>
623
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
624
     * </dl>
625
     * 
626
     * @param o1
627
     *            the first source Observable
628
     * @param o2
629
     *            the second source Observable
630
     * @param o3
631
     *            the third source Observable
632
     * @param combineFunction
633
     *            the aggregation function used to combine the items emitted by the source Observables
634
     * @return an Observable that emits items that are the result of combining the items emitted by the source
635
     *         Observables by means of the given aggregation function
636
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
637
     */
638
    @SuppressWarnings("unchecked")
639
    public static <T1, T2, T3, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Func3<? super T1, ? super T2, ? super T3, ? extends R> combineFunction) {
640 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2, o3), Functions.fromFunc(combineFunction));
641
    }
642
643
    /**
644
     * Combines four source Observables by emitting an item that aggregates the latest values of each of the
645
     * source Observables each time an item is received from any of the source Observables, where this
646
     * aggregation is defined by a specified function.
647
     * <p>
648
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
649
     * <dl>
650
     *  <dt><b>Scheduler:</b></dt>
651
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
652
     * </dl>
653
     * 
654
     * @param o1
655
     *            the first source Observable
656
     * @param o2
657
     *            the second source Observable
658
     * @param o3
659
     *            the third source Observable
660
     * @param o4
661
     *            the fourth source Observable
662
     * @param combineFunction
663
     *            the aggregation function used to combine the items emitted by the source Observables
664
     * @return an Observable that emits items that are the result of combining the items emitted by the source
665
     *         Observables by means of the given aggregation function
666
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
667
     */
668
    @SuppressWarnings("unchecked")
669
    public static <T1, T2, T3, T4, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4,
670
            Func4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> combineFunction) {
671 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2, o3, o4), Functions.fromFunc(combineFunction));
672
    }
673
674
    /**
675
     * Combines five source Observables by emitting an item that aggregates the latest values of each of the
676
     * source Observables each time an item is received from any of the source Observables, where this
677
     * aggregation is defined by a specified function.
678
     * <p>
679
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
680
     * <dl>
681
     *  <dt><b>Scheduler:</b></dt>
682
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
683
     * </dl>
684
     * 
685
     * @param o1
686
     *            the first source Observable
687
     * @param o2
688
     *            the second source Observable
689
     * @param o3
690
     *            the third source Observable
691
     * @param o4
692
     *            the fourth source Observable
693
     * @param o5
694
     *            the fifth source Observable
695
     * @param combineFunction
696
     *            the aggregation function used to combine the items emitted by the source Observables
697
     * @return an Observable that emits items that are the result of combining the items emitted by the source
698
     *         Observables by means of the given aggregation function
699
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
700
     */
701
    @SuppressWarnings("unchecked")
702
    public static <T1, T2, T3, T4, T5, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5,
703
            Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> combineFunction) {
704 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2, o3, o4, o5), Functions.fromFunc(combineFunction));
705
    }
706
707
    /**
708
     * Combines six source Observables by emitting an item that aggregates the latest values of each of the
709
     * source Observables each time an item is received from any of the source Observables, where this
710
     * aggregation is defined by a specified function.
711
     * <p>
712
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
713
     * <dl>
714
     *  <dt><b>Scheduler:</b></dt>
715
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
716
     * </dl>
717
     * 
718
     * @param o1
719
     *            the first source Observable
720
     * @param o2
721
     *            the second source Observable
722
     * @param o3
723
     *            the third source Observable
724
     * @param o4
725
     *            the fourth source Observable
726
     * @param o5
727
     *            the fifth source Observable
728
     * @param o6
729
     *            the sixth source Observable
730
     * @param combineFunction
731
     *            the aggregation function used to combine the items emitted by the source Observables
732
     * @return an Observable that emits items that are the result of combining the items emitted by the source
733
     *         Observables by means of the given aggregation function
734
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
735
     */
736
    @SuppressWarnings("unchecked")
737
    public static <T1, T2, T3, T4, T5, T6, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6,
738
            Func6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> combineFunction) {
739 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2, o3, o4, o5, o6), Functions.fromFunc(combineFunction));
740
    }
741
742
    /**
743
     * Combines seven source Observables by emitting an item that aggregates the latest values of each of the
744
     * source Observables each time an item is received from any of the source Observables, where this
745
     * aggregation is defined by a specified function.
746
     * <p>
747
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
748
     * <dl>
749
     *  <dt><b>Scheduler:</b></dt>
750
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
751
     * </dl>
752
     * 
753
     * @param o1
754
     *            the first source Observable
755
     * @param o2
756
     *            the second source Observable
757
     * @param o3
758
     *            the third source Observable
759
     * @param o4
760
     *            the fourth source Observable
761
     * @param o5
762
     *            the fifth source Observable
763
     * @param o6
764
     *            the sixth source Observable
765
     * @param o7
766
     *            the seventh source Observable
767
     * @param combineFunction
768
     *            the aggregation function used to combine the items emitted by the source Observables
769
     * @return an Observable that emits items that are the result of combining the items emitted by the source
770
     *         Observables by means of the given aggregation function
771
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
772
     */
773
    @SuppressWarnings("unchecked")
774
    public static <T1, T2, T3, T4, T5, T6, T7, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7,
775
            Func7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> combineFunction) {
776 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2, o3, o4, o5, o6, o7), Functions.fromFunc(combineFunction));
777
    }
778
779
    /**
780
     * Combines eight source Observables by emitting an item that aggregates the latest values of each of the
781
     * source Observables each time an item is received from any of the source Observables, where this
782
     * aggregation is defined by a specified function.
783
     * <p>
784
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
785
     * <dl>
786
     *  <dt><b>Scheduler:</b></dt>
787
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
788
     * </dl>
789
     * 
790
     * @param o1
791
     *            the first source Observable
792
     * @param o2
793
     *            the second source Observable
794
     * @param o3
795
     *            the third source Observable
796
     * @param o4
797
     *            the fourth source Observable
798
     * @param o5
799
     *            the fifth source Observable
800
     * @param o6
801
     *            the sixth source Observable
802
     * @param o7
803
     *            the seventh source Observable
804
     * @param o8
805
     *            the eighth source Observable
806
     * @param combineFunction
807
     *            the aggregation function used to combine the items emitted by the source Observables
808
     * @return an Observable that emits items that are the result of combining the items emitted by the source
809
     *         Observables by means of the given aggregation function
810
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
811
     */
812
    @SuppressWarnings("unchecked")
813
    public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8,
814
            Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> combineFunction) {
815 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2, o3, o4, o5, o6, o7, o8), Functions.fromFunc(combineFunction));
816
    }
817
818
    /**
819
     * Combines nine source Observables by emitting an item that aggregates the latest values of each of the
820
     * source Observables each time an item is received from any of the source Observables, where this
821
     * aggregation is defined by a specified function.
822
     * <p>
823
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/combineLatest.png" alt="">
824
     * <dl>
825
     *  <dt><b>Scheduler:</b></dt>
826
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
827
     * </dl>
828
     * 
829
     * @param o1
830
     *            the first source Observable
831
     * @param o2
832
     *            the second source Observable
833
     * @param o3
834
     *            the third source Observable
835
     * @param o4
836
     *            the fourth source Observable
837
     * @param o5
838
     *            the fifth source Observable
839
     * @param o6
840
     *            the sixth source Observable
841
     * @param o7
842
     *            the seventh source Observable
843
     * @param o8
844
     *            the eighth source Observable
845
     * @param o9
846
     *            the ninth source Observable
847
     * @param combineFunction
848
     *            the aggregation function used to combine the items emitted by the source Observables
849
     * @return an Observable that emits items that are the result of combining the items emitted by the source
850
     *         Observables by means of the given aggregation function
851
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
852
     */
853
    @SuppressWarnings("unchecked")
854
    public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> Observable<R> combineLatest(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8,
855
            Observable<? extends T9> o9,
856
            Func9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> combineFunction) {
857 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return combineLatest(Arrays.asList(o1, o2, o3, o4, o5, o6, o7, o8, o9), Functions.fromFunc(combineFunction));
858
    }
859
    /**
860
     * Combines a list of source Observables by emitting an item that aggregates the latest values of each of
861
     * the source Observables each time an item is received from any of the source Observables, where this
862
     * aggregation is defined by a specified function.
863
     * <dl>
864
     *  <dt><b>Scheduler:</b></dt>
865
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
866
     * </dl>
867
     *
868
     * @param <T>
869
     *            the common base type of source values
870
     * @param <R>
871
     *            the result type
872
     * @param sources
873
     *            the list of source Observables
874
     * @param combineFunction
875
     *            the aggregation function used to combine the items emitted by the source Observables
876
     * @return an Observable that emits items that are the result of combining the items emitted by the source
877
     *         Observables by means of the given aggregation function
878
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
879
     */
880
    public static <T, R> Observable<R> combineLatest(List<? extends Observable<? extends T>> sources, FuncN<? extends R> combineFunction) {
881 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeCombineLatest<T, R>(sources, combineFunction));
882
    }
883
884
    /**
885
     * Combines a collection of source Observables by emitting an item that aggregates the latest values of each of
886
     * the source Observables each time an item is received from any of the source Observables, where this
887
     * aggregation is defined by a specified function.
888
     * <dl>
889
     *  <dt><b>Scheduler:</b></dt>
890
     *  <dd>{@code combineLatest} does not operate by default on a particular {@link Scheduler}.</dd>
891
     * </dl>
892
     *
893
     * @param <T>
894
     *            the common base type of source values
895
     * @param <R>
896
     *            the result type
897
     * @param sources
898
     *            the collection of source Observables
899
     * @param combineFunction
900
     *            the aggregation function used to combine the items emitted by the source Observables
901
     * @return an Observable that emits items that are the result of combining the items emitted by the source
902
     *         Observables by means of the given aggregation function
903
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
904
     */
905
    public static <T, R> Observable<R> combineLatest(Iterable<? extends Observable<? extends T>> sources, FuncN<? extends R> combineFunction) {
906 1 1. combineLatest : mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(new OnSubscribeCombineLatest<T, R>(sources, combineFunction));
907
    }
908
909
    /**
910
     * Returns an Observable that emits the items emitted by each of the Observables emitted by the source
911
     * Observable, one after the other, without interleaving them.
912
     * <p>
913
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
914
     * <dl>
915
     *  <dt><b>Scheduler:</b></dt>
916
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
917
     * </dl>
918
     *
919
     * @param observables
920
     *            an Observable that emits Observables
921
     * @return an Observable that emits items all of the items emitted by the Observables emitted by
922
     *         {@code observables}, one after the other, without interleaving them
923
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
924
     */
925
    public static <T> Observable<T> concat(Observable<? extends Observable<? extends T>> observables) {
926 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return observables.lift(OperatorConcat.<T>instance());
927
    }
928
929
    /**
930
     * Returns an Observable that emits the items emitted by two Observables, one after the other, without
931
     * interleaving them.
932
     * <p>
933
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
934
     * <dl>
935
     *  <dt><b>Scheduler:</b></dt>
936
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
937
     * </dl>
938
     *
939
     * @param t1
940
     *            an Observable to be concatenated
941
     * @param t2
942
     *            an Observable to be concatenated
943
     * @return an Observable that emits items emitted by the two source Observables, one after the other,
944
     *         without interleaving them
945
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
946
     */
947
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2) {
948 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concat(just(t1, t2));
949
    }
950
951
    /**
952
     * Returns an Observable that emits the items emitted by three Observables, one after the other, without
953
     * interleaving them.
954
     * <p>
955
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
956
     * <dl>
957
     *  <dt><b>Scheduler:</b></dt>
958
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
959
     * </dl>
960
     *
961
     * @param t1
962
     *            an Observable to be concatenated
963
     * @param t2
964
     *            an Observable to be concatenated
965
     * @param t3
966
     *            an Observable to be concatenated
967
     * @return an Observable that emits items emitted by the three source Observables, one after the other,
968
     *         without interleaving them
969
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
970
     */
971
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3) {
972 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3));
973
    }
974
975
    /**
976
     * Returns an Observable that emits the items emitted by four Observables, one after the other, without
977
     * interleaving them.
978
     * <p>
979
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
980
     * <dl>
981
     *  <dt><b>Scheduler:</b></dt>
982
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
983
     * </dl>
984
     * 
985
     * @param t1
986
     *            an Observable to be concatenated
987
     * @param t2
988
     *            an Observable to be concatenated
989
     * @param t3
990
     *            an Observable to be concatenated
991
     * @param t4
992
     *            an Observable to be concatenated
993
     * @return an Observable that emits items emitted by the four source Observables, one after the other,
994
     *         without interleaving them
995
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
996
     */
997
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4) {
998 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4));
999
    }
1000
1001
    /**
1002
     * Returns an Observable that emits the items emitted by five Observables, one after the other, without
1003
     * interleaving them.
1004
     * <p>
1005
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
1006
     * <dl>
1007
     *  <dt><b>Scheduler:</b></dt>
1008
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
1009
     * </dl>
1010
     *
1011
     * @param t1
1012
     *            an Observable to be concatenated
1013
     * @param t2
1014
     *            an Observable to be concatenated
1015
     * @param t3
1016
     *            an Observable to be concatenated
1017
     * @param t4
1018
     *            an Observable to be concatenated
1019
     * @param t5
1020
     *            an Observable to be concatenated
1021
     * @return an Observable that emits items emitted by the five source Observables, one after the other,
1022
     *         without interleaving them
1023
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
1024
     */
1025
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5) {
1026 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5));
1027
    }
1028
1029
    /**
1030
     * Returns an Observable that emits the items emitted by six Observables, one after the other, without
1031
     * interleaving them.
1032
     * <p>
1033
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
1034
     * <dl>
1035
     *  <dt><b>Scheduler:</b></dt>
1036
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
1037
     * </dl>
1038
     *
1039
     * @param t1
1040
     *            an Observable to be concatenated
1041
     * @param t2
1042
     *            an Observable to be concatenated
1043
     * @param t3
1044
     *            an Observable to be concatenated
1045
     * @param t4
1046
     *            an Observable to be concatenated
1047
     * @param t5
1048
     *            an Observable to be concatenated
1049
     * @param t6
1050
     *            an Observable to be concatenated
1051
     * @return an Observable that emits items emitted by the six source Observables, one after the other,
1052
     *         without interleaving them
1053
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
1054
     */
1055
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6) {
1056 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6));
1057
    }
1058
1059
    /**
1060
     * Returns an Observable that emits the items emitted by seven Observables, one after the other, without
1061
     * interleaving them.
1062
     * <p>
1063
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
1064
     * <dl>
1065
     *  <dt><b>Scheduler:</b></dt>
1066
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
1067
     * </dl>
1068
     *
1069
     * @param t1
1070
     *            an Observable to be concatenated
1071
     * @param t2
1072
     *            an Observable to be concatenated
1073
     * @param t3
1074
     *            an Observable to be concatenated
1075
     * @param t4
1076
     *            an Observable to be concatenated
1077
     * @param t5
1078
     *            an Observable to be concatenated
1079
     * @param t6
1080
     *            an Observable to be concatenated
1081
     * @param t7
1082
     *            an Observable to be concatenated
1083
     * @return an Observable that emits items emitted by the seven source Observables, one after the other,
1084
     *         without interleaving them
1085
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
1086
     */
1087
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7) {
1088 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6, t7));
1089
    }
1090
1091
    /**
1092
     * Returns an Observable that emits the items emitted by eight Observables, one after the other, without
1093
     * interleaving them.
1094
     * <p>
1095
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
1096
     * <dl>
1097
     *  <dt><b>Scheduler:</b></dt>
1098
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
1099
     * </dl>
1100
     * 
1101
     * @param t1
1102
     *            an Observable to be concatenated
1103
     * @param t2
1104
     *            an Observable to be concatenated
1105
     * @param t3
1106
     *            an Observable to be concatenated
1107
     * @param t4
1108
     *            an Observable to be concatenated
1109
     * @param t5
1110
     *            an Observable to be concatenated
1111
     * @param t6
1112
     *            an Observable to be concatenated
1113
     * @param t7
1114
     *            an Observable to be concatenated
1115
     * @param t8
1116
     *            an Observable to be concatenated
1117
     * @return an Observable that emits items emitted by the eight source Observables, one after the other,
1118
     *         without interleaving them
1119
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
1120
     */
1121
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7, Observable<? extends T> t8) {
1122 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6, t7, t8));
1123
    }
1124
1125
    /**
1126
     * Returns an Observable that emits the items emitted by nine Observables, one after the other, without
1127
     * interleaving them.
1128
     * <p>
1129
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
1130
     * <dl>
1131
     *  <dt><b>Scheduler:</b></dt>
1132
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
1133
     * </dl>
1134
     * 
1135
     * @param t1
1136
     *            an Observable to be concatenated
1137
     * @param t2
1138
     *            an Observable to be concatenated
1139
     * @param t3
1140
     *            an Observable to be concatenated
1141
     * @param t4
1142
     *            an Observable to be concatenated
1143
     * @param t5
1144
     *            an Observable to be concatenated
1145
     * @param t6
1146
     *            an Observable to be concatenated
1147
     * @param t7
1148
     *            an Observable to be concatenated
1149
     * @param t8
1150
     *            an Observable to be concatenated
1151
     * @param t9
1152
     *            an Observable to be concatenated
1153
     * @return an Observable that emits items emitted by the nine source Observables, one after the other,
1154
     *         without interleaving them
1155
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
1156
     */
1157
    public static <T> Observable<T> concat(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7, Observable<? extends T> t8, Observable<? extends T> t9) {
1158 1 1. concat : mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6, t7, t8, t9));
1159
    }
1160
1161
    /**
1162
     * Returns an Observable that calls an Observable factory to create an Observable for each new Observer
1163
     * that subscribes. That is, for each subscriber, the actual Observable that subscriber observes is
1164
     * determined by the factory function.
1165
     * <p>
1166
     * <img width="640" height="340" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/defer.png" alt="">
1167
     * <p>
1168
     * The defer Observer allows you to defer or delay emitting items from an Observable until such time as an
1169
     * Observer subscribes to the Observable. This allows an {@link Observer} to easily obtain updates or a
1170
     * refreshed version of the sequence.
1171
     * <dl>
1172
     *  <dt><b>Scheduler:</b></dt>
1173
     *  <dd>{@code defer} does not operate by default on a particular {@link Scheduler}.</dd>
1174
     * </dl>
1175
     * 
1176
     * @param observableFactory
1177
     *            the Observable factory function to invoke for each {@link Observer} that subscribes to the
1178
     *            resulting Observable
1179
     * @param <T>
1180
     *            the type of the items emitted by the Observable
1181
     * @return an Observable whose {@link Observer}s' subscriptions trigger an invocation of the given
1182
     *         Observable factory function
1183
     * @see <a href="http://reactivex.io/documentation/operators/defer.html">ReactiveX operators documentation: Defer</a>
1184
     */
1185
    public static <T> Observable<T> defer(Func0<Observable<T>> observableFactory) {
1186 1 1. defer : mutated return of Object value for rx/Observable::defer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeDefer<T>(observableFactory));
1187
    }
1188
1189
    /** Lazy initialized Holder for an empty observable which just emits onCompleted to any subscriber. */
1190
    private static final class EmptyHolder {
1191
        final static Observable<Object> INSTANCE = create(new OnSubscribe<Object>() {
1192
            @Override
1193
            public void call(Subscriber<? super Object> subscriber) {
1194 1 1. call : removed call to rx/Subscriber::onCompleted → KILLED
                subscriber.onCompleted();
1195
            }
1196
        });
1197
    }
1198
    
1199
    /**
1200
     * Returns an Observable that emits no items to the {@link Observer} and immediately invokes its
1201
     * {@link Observer#onCompleted onCompleted} method.
1202
     * <p>
1203
     * <img width="640" height="190" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/empty.png" alt="">
1204
     * <dl>
1205
     *  <dt><b>Scheduler:</b></dt>
1206
     *  <dd>{@code empty} does not operate by default on a particular {@link Scheduler}.</dd>
1207
     * </dl>
1208
     *
1209
     * @param <T>
1210
     *            the type of the items (ostensibly) emitted by the Observable
1211
     * @return an Observable that emits no items to the {@link Observer} but immediately invokes the
1212
     *         {@link Observer}'s {@link Observer#onCompleted() onCompleted} method
1213
     * @see <a href="http://reactivex.io/documentation/operators/empty-never-throw.html">ReactiveX operators documentation: Empty</a>
1214
     */
1215
    @SuppressWarnings("unchecked")
1216
    public static <T> Observable<T> empty() {
1217 1 1. empty : mutated return of Object value for rx/Observable::empty to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return (Observable<T>) EmptyHolder.INSTANCE;
1218
    }
1219
1220
    /**
1221
     * Returns an Observable that invokes an {@link Observer}'s {@link Observer#onError onError} method when the
1222
     * Observer subscribes to it.
1223
     * <p>
1224
     * <img width="640" height="190" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/error.png" alt="">
1225
     * <dl>
1226
     *  <dt><b>Scheduler:</b></dt>
1227
     *  <dd>{@code error} does not operate by default on a particular {@link Scheduler}.</dd>
1228
     * </dl>
1229
     * 
1230
     * @param exception
1231
     *            the particular Throwable to pass to {@link Observer#onError onError}
1232
     * @param <T>
1233
     *            the type of the items (ostensibly) emitted by the Observable
1234
     * @return an Observable that invokes the {@link Observer}'s {@link Observer#onError onError} method when
1235
     *         the Observer subscribes to it
1236
     * @see <a href="http://reactivex.io/documentation/operators/empty-never-throw.html">ReactiveX operators documentation: Throw</a>
1237
     */
1238
    public static <T> Observable<T> error(Throwable exception) {
1239 1 1. error : mutated return of Object value for rx/Observable::error to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return new ThrowObservable<T>(exception);
1240
    }
1241
1242
    /**
1243
     * Converts a {@link Future} into an Observable.
1244
     * <p>
1245
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/from.Future.png" alt="">
1246
     * <p>
1247
     * You can convert any object that supports the {@link Future} interface into an Observable that emits the
1248
     * return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
1249
     * method.
1250
     * <p>
1251
     * <em>Important note:</em> This Observable is blocking; you cannot unsubscribe from it.
1252
     * <dl>
1253
     *  <dt><b>Scheduler:</b></dt>
1254
     *  <dd>{@code from} does not operate by default on a particular {@link Scheduler}.</dd>
1255
     * </dl>
1256
     * 
1257
     * @param future
1258
     *            the source {@link Future}
1259
     * @param <T>
1260
     *            the type of object that the {@link Future} returns, and also the type of item to be emitted by
1261
     *            the resulting Observable
1262
     * @return an Observable that emits the item from the source {@link Future}
1263
     * @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a>
1264
     */
1265
    public static <T> Observable<T> from(Future<? extends T> future) {
1266 1 1. from : mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(OnSubscribeToObservableFuture.toObservableFuture(future));
1267
    }
1268
1269
    /**
1270
     * Converts a {@link Future} into an Observable, with a timeout on the Future.
1271
     * <p>
1272
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/from.Future.png" alt="">
1273
     * <p>
1274
     * You can convert any object that supports the {@link Future} interface into an Observable that emits the
1275
     * return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
1276
     * method.
1277
     * <p>
1278
     * <em>Important note:</em> This Observable is blocking; you cannot unsubscribe from it.
1279
     * <dl>
1280
     *  <dt><b>Scheduler:</b></dt>
1281
     *  <dd>{@code from} does not operate by default on a particular {@link Scheduler}.</dd>
1282
     * </dl>
1283
     * 
1284
     * @param future
1285
     *            the source {@link Future}
1286
     * @param timeout
1287
     *            the maximum time to wait before calling {@code get}
1288
     * @param unit
1289
     *            the {@link TimeUnit} of the {@code timeout} argument
1290
     * @param <T>
1291
     *            the type of object that the {@link Future} returns, and also the type of item to be emitted by
1292
     *            the resulting Observable
1293
     * @return an Observable that emits the item from the source {@link Future}
1294
     * @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a>
1295
     */
1296
    public static <T> Observable<T> from(Future<? extends T> future, long timeout, TimeUnit unit) {
1297 1 1. from : mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeToObservableFuture.toObservableFuture(future, timeout, unit));
1298
    }
1299
1300
    /**
1301
     * Converts a {@link Future}, operating on a specified {@link Scheduler}, into an Observable.
1302
     * <p>
1303
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/from.Future.s.png" alt="">
1304
     * <p>
1305
     * You can convert any object that supports the {@link Future} interface into an Observable that emits the
1306
     * return value of the {@link Future#get} method of that object, by passing the object into the {@code from}
1307
     * method.
1308
     * <dl>
1309
     *  <dt><b>Scheduler:</b></dt>
1310
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
1311
     * </dl>
1312
     * 
1313
     * @param future
1314
     *            the source {@link Future}
1315
     * @param scheduler
1316
     *            the {@link Scheduler} to wait for the Future on. Use a Scheduler such as
1317
     *            {@link Schedulers#io()} that can block and wait on the Future
1318
     * @param <T>
1319
     *            the type of object that the {@link Future} returns, and also the type of item to be emitted by
1320
     *            the resulting Observable
1321
     * @return an Observable that emits the item from the source {@link Future}
1322
     * @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a>
1323
     */
1324
    public static <T> Observable<T> from(Future<? extends T> future, Scheduler scheduler) {
1325
        // TODO in a future revision the Scheduler will become important because we'll start polling instead of blocking on the Future
1326 1 1. from : mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return create(OnSubscribeToObservableFuture.toObservableFuture(future)).subscribeOn(scheduler);
1327
    }
1328
1329
    /**
1330
     * Converts an {@link Iterable} sequence into an Observable that emits the items in the sequence.
1331
     * <p>
1332
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/from.png" alt="">
1333
     * <dl>
1334
     *  <dt><b>Scheduler:</b></dt>
1335
     *  <dd>{@code from} does not operate by default on a particular {@link Scheduler}.</dd>
1336
     * </dl>
1337
     * 
1338
     * @param iterable
1339
     *            the source {@link Iterable} sequence
1340
     * @param <T>
1341
     *            the type of items in the {@link Iterable} sequence and the type of items to be emitted by the
1342
     *            resulting Observable
1343
     * @return an Observable that emits each item in the source {@link Iterable} sequence
1344
     * @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a>
1345
     */
1346
    public static <T> Observable<T> from(Iterable<? extends T> iterable) {
1347 1 1. from : mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeFromIterable<T>(iterable));
1348
    }
1349
1350
    /**
1351
     * Converts an Array into an Observable that emits the items in the Array.
1352
     * <p>
1353
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/from.png" alt="">
1354
     * <dl>
1355
     *  <dt><b>Scheduler:</b></dt>
1356
     *  <dd>{@code from} does not operate by default on a particular {@link Scheduler}.</dd>
1357
     * </dl>
1358
     * 
1359
     * @param array
1360
     *            the source Array
1361
     * @param <T>
1362
     *            the type of items in the Array and the type of items to be emitted by the resulting Observable
1363
     * @return an Observable that emits each item in the source Array
1364
     * @see <a href="http://reactivex.io/documentation/operators/from.html">ReactiveX operators documentation: From</a>
1365
     */
1366
    public static <T> Observable<T> from(T[] array) {
1367
        int n = array.length;
1368 1 1. from : negated conditional → KILLED
        if (n == 0) {
1369 1 1. from : mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return empty();
1370
        } else
1371 1 1. from : negated conditional → KILLED
        if (n == 1) {
1372 1 1. from : mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return just(array[0]);
1373
        }
1374 1 1. from : mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeFromArray<T>(array));
1375
    }
1376
1377
    /**
1378
     * Returns an Observable that, when an observer subscribes to it, invokes a function you specify and then
1379
     * emits the value returned from that function.
1380
     * <p>
1381
     * <img width="640" height="195" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromCallable.png" alt="">
1382
     * <p>
1383
     * This allows you to defer the execution of the function you specify until an observer subscribes to the
1384
     * Observable. That is to say, it makes the function "lazy."
1385
     * <dl>
1386
     *   <dt><b>Scheduler:</b></dt>
1387
     *   <dd>{@code fromCallable} does not operate by default on a particular {@link Scheduler}.</dd>
1388
     * </dl>
1389
     *
1390
     * @param func
1391
     *         a function, the execution of which should be deferred; {@code fromCallable} will invoke this
1392
     *         function only when an observer subscribes to the Observable that {@code fromCallable} returns
1393
     * @param <T>
1394
     *         the type of the item emitted by the Observable
1395
     * @return an Observable whose {@link Observer}s' subscriptions trigger an invocation of the given function
1396
     * @see #defer(Func0)
1397
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
1398
     */
1399
    @Experimental
1400
    public static <T> Observable<T> fromCallable(Callable<? extends T> func) {
1401 1 1. fromCallable : mutated return of Object value for rx/Observable::fromCallable to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeFromCallable<T>(func));
1402
    }
1403
1404
    /**
1405
     * Returns an Observable that emits a sequential number every specified interval of time.
1406
     * <p>
1407
     * <img width="640" height="195" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/interval.png" alt="">
1408
     * <dl>
1409
     *  <dt><b>Scheduler:</b></dt>
1410
     *  <dd>{@code interval} operates by default on the {@code computation} {@link Scheduler}.</dd>
1411
     * </dl>
1412
     * 
1413
     * @param interval
1414
     *            interval size in time units (see below)
1415
     * @param unit
1416
     *            time units to use for the interval size
1417
     * @return an Observable that emits a sequential number each time interval
1418
     * @see <a href="http://reactivex.io/documentation/operators/interval.html">ReactiveX operators documentation: Interval</a>
1419
     */
1420
    public static Observable<Long> interval(long interval, TimeUnit unit) {
1421 1 1. interval : mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return interval(interval, interval, unit, Schedulers.computation());
1422
    }
1423
1424
    /**
1425
     * Returns an Observable that emits a sequential number every specified interval of time, on a
1426
     * specified Scheduler.
1427
     * <p>
1428
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/interval.s.png" alt="">
1429
     * <dl>
1430
     *  <dt><b>Scheduler:</b></dt>
1431
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
1432
     * </dl>
1433
     * 
1434
     * @param interval
1435
     *            interval size in time units (see below)
1436
     * @param unit
1437
     *            time units to use for the interval size
1438
     * @param scheduler
1439
     *            the Scheduler to use for scheduling the items
1440
     * @return an Observable that emits a sequential number each time interval
1441
     * @see <a href="http://reactivex.io/documentation/operators/interval.html">ReactiveX operators documentation: Interval</a>
1442
     */
1443
    public static Observable<Long> interval(long interval, TimeUnit unit, Scheduler scheduler) {
1444 1 1. interval : mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return interval(interval, interval, unit, scheduler);
1445
    }
1446
1447
    /**
1448
     * Returns an Observable that emits a {@code 0L} after the {@code initialDelay} and ever increasing numbers
1449
     * after each {@code period} of time thereafter.
1450
     * <p>
1451
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timer.p.png" alt="">
1452
     * <dl>
1453
     *  <dt><b>Backpressure Support:</b></dt>
1454
     *  <dd>This operator does not support backpressure as it uses time. If the downstream needs a slower rate
1455
     *      it should slow the timer or use something like {@link #onBackpressureDrop}.</dd>
1456
     *  <dt><b>Scheduler:</b></dt>
1457
     *  <dd>{@code interval} operates by default on the {@code computation} {@link Scheduler}.</dd>
1458
     * </dl>
1459
     * 
1460
     * @param initialDelay
1461
     *            the initial delay time to wait before emitting the first value of 0L
1462
     * @param period
1463
     *            the period of time between emissions of the subsequent numbers
1464
     * @param unit
1465
     *            the time unit for both {@code initialDelay} and {@code period}
1466
     * @return an Observable that emits a 0L after the {@code initialDelay} and ever increasing numbers after
1467
     *         each {@code period} of time thereafter
1468
     * @see <a href="http://reactivex.io/documentation/operators/interval.html">ReactiveX operators documentation: Interval</a>
1469
     * @since 1.0.12
1470
     */
1471
    public static Observable<Long> interval(long initialDelay, long period, TimeUnit unit) {
1472 1 1. interval : mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return interval(initialDelay, period, unit, Schedulers.computation());
1473
    }
1474
1475
    /**
1476
     * Returns an Observable that emits a {@code 0L} after the {@code initialDelay} and ever increasing numbers
1477
     * after each {@code period} of time thereafter, on a specified {@link Scheduler}.
1478
     * <p>
1479
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timer.ps.png" alt="">
1480
     * <dl>
1481
     *  <dt><b>Backpressure Support:</b></dt>
1482
     *  <dd>This operator does not support backpressure as it uses time. If the downstream needs a slower rate
1483
     *      it should slow the timer or use something like {@link #onBackpressureDrop}.</dd>
1484
     *  <dt><b>Scheduler:</b></dt>
1485
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
1486
     * </dl>
1487
     * 
1488
     * @param initialDelay
1489
     *            the initial delay time to wait before emitting the first value of 0L
1490
     * @param period
1491
     *            the period of time between emissions of the subsequent numbers
1492
     * @param unit
1493
     *            the time unit for both {@code initialDelay} and {@code period}
1494
     * @param scheduler
1495
     *            the Scheduler on which the waiting happens and items are emitted
1496
     * @return an Observable that emits a 0L after the {@code initialDelay} and ever increasing numbers after
1497
     *         each {@code period} of time thereafter, while running on the given Scheduler
1498
     * @see <a href="http://reactivex.io/documentation/operators/interval.html">ReactiveX operators documentation: Interval</a>
1499
     * @since 1.0.12
1500
     */
1501
    public static Observable<Long> interval(long initialDelay, long period, TimeUnit unit, Scheduler scheduler) {
1502 1 1. interval : mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeTimerPeriodically(initialDelay, period, unit, scheduler));
1503
    }
1504
1505
    /**
1506
     * Returns an Observable that emits a single item and then completes.
1507
     * <p>
1508
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.png" alt="">
1509
     * <p>
1510
     * To convert any object into an Observable that emits that object, pass that object into the {@code just}
1511
     * method.
1512
     * <p>
1513
     * This is similar to the {@link #from(java.lang.Object[])} method, except that {@code from} will convert
1514
     * an {@link Iterable} object into an Observable that emits each of the items in the Iterable, one at a
1515
     * time, while the {@code just} method converts an Iterable into an Observable that emits the entire
1516
     * Iterable as a single item.
1517
     * <dl>
1518
     *  <dt><b>Scheduler:</b></dt>
1519
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1520
     * </dl>
1521
     * 
1522
     * @param value
1523
     *            the item to emit
1524
     * @param <T>
1525
     *            the type of that item
1526
     * @return an Observable that emits {@code value} as a single item and then completes
1527
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1528
     */
1529
    public static <T> Observable<T> just(final T value) {
1530 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return ScalarSynchronousObservable.create(value);
1531
    }
1532
    
1533
    /**
1534
     * Converts two items into an Observable that emits those items.
1535
     * <p>
1536
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1537
     * <dl>
1538
     *  <dt><b>Scheduler:</b></dt>
1539
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1540
     * </dl>
1541
     * 
1542
     * @param t1
1543
     *            first item
1544
     * @param t2
1545
     *            second item
1546
     * @param <T>
1547
     *            the type of these items
1548
     * @return an Observable that emits each item
1549
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1550
     */
1551
    // suppress unchecked because we are using varargs inside the method
1552
    @SuppressWarnings("unchecked")
1553
    public static <T> Observable<T> just(T t1, T t2) {
1554 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2 });
1555
    }
1556
1557
    /**
1558
     * Converts three items into an Observable that emits those items.
1559
     * <p>
1560
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1561
     * <dl>
1562
     *  <dt><b>Scheduler:</b></dt>
1563
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1564
     * </dl>
1565
     * 
1566
     * @param t1
1567
     *            first item
1568
     * @param t2
1569
     *            second item
1570
     * @param t3
1571
     *            third item
1572
     * @param <T>
1573
     *            the type of these items
1574
     * @return an Observable that emits each item
1575
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1576
     */
1577
    // suppress unchecked because we are using varargs inside the method
1578
    @SuppressWarnings("unchecked")
1579
    public static <T> Observable<T> just(T t1, T t2, T t3) {
1580 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3 });
1581
    }
1582
1583
    /**
1584
     * Converts four items into an Observable that emits those items.
1585
     * <p>
1586
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1587
     * <dl>
1588
     *  <dt><b>Scheduler:</b></dt>
1589
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1590
     * </dl>
1591
     * 
1592
     * @param t1
1593
     *            first item
1594
     * @param t2
1595
     *            second item
1596
     * @param t3
1597
     *            third item
1598
     * @param t4
1599
     *            fourth item
1600
     * @param <T>
1601
     *            the type of these items
1602
     * @return an Observable that emits each item
1603
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1604
     */
1605
    // suppress unchecked because we are using varargs inside the method
1606
    @SuppressWarnings("unchecked")
1607
    public static <T> Observable<T> just(T t1, T t2, T t3, T t4) {
1608 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3, t4 });
1609
    }
1610
1611
    /**
1612
     * Converts five items into an Observable that emits those items.
1613
     * <p>
1614
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1615
     * <dl>
1616
     *  <dt><b>Scheduler:</b></dt>
1617
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1618
     * </dl>
1619
     *
1620
     * @param t1
1621
     *            first item
1622
     * @param t2
1623
     *            second item
1624
     * @param t3
1625
     *            third item
1626
     * @param t4
1627
     *            fourth item
1628
     * @param t5
1629
     *            fifth item
1630
     * @param <T>
1631
     *            the type of these items
1632
     * @return an Observable that emits each item
1633
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1634
     */
1635
    // suppress unchecked because we are using varargs inside the method
1636
    @SuppressWarnings("unchecked")
1637
    public static <T> Observable<T> just(T t1, T t2, T t3, T t4, T t5) {
1638 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3, t4, t5 });
1639
    }
1640
1641
    /**
1642
     * Converts six items into an Observable that emits those items.
1643
     * <p>
1644
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1645
     * <dl>
1646
     *  <dt><b>Scheduler:</b></dt>
1647
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1648
     * </dl>
1649
     * 
1650
     * @param t1
1651
     *            first item
1652
     * @param t2
1653
     *            second item
1654
     * @param t3
1655
     *            third item
1656
     * @param t4
1657
     *            fourth item
1658
     * @param t5
1659
     *            fifth item
1660
     * @param t6
1661
     *            sixth item
1662
     * @param <T>
1663
     *            the type of these items
1664
     * @return an Observable that emits each item
1665
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1666
     */
1667
    // suppress unchecked because we are using varargs inside the method
1668
    @SuppressWarnings("unchecked")
1669
    public static <T> Observable<T> just(T t1, T t2, T t3, T t4, T t5, T t6) {
1670 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3, t4, t5, t6 });
1671
    }
1672
1673
    /**
1674
     * Converts seven items into an Observable that emits those items.
1675
     * <p>
1676
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1677
     * <dl>
1678
     *  <dt><b>Scheduler:</b></dt>
1679
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1680
     * </dl>
1681
     * 
1682
     * @param t1
1683
     *            first item
1684
     * @param t2
1685
     *            second item
1686
     * @param t3
1687
     *            third item
1688
     * @param t4
1689
     *            fourth item
1690
     * @param t5
1691
     *            fifth item
1692
     * @param t6
1693
     *            sixth item
1694
     * @param t7
1695
     *            seventh item
1696
     * @param <T>
1697
     *            the type of these items
1698
     * @return an Observable that emits each item
1699
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1700
     */
1701
    // suppress unchecked because we are using varargs inside the method
1702
    @SuppressWarnings("unchecked")
1703
    public static <T> Observable<T> just(T t1, T t2, T t3, T t4, T t5, T t6, T t7) {
1704 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3, t4, t5, t6, t7 });
1705
    }
1706
1707
    /**
1708
     * Converts eight items into an Observable that emits those items.
1709
     * <p>
1710
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1711
     * <dl>
1712
     *  <dt><b>Scheduler:</b></dt>
1713
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1714
     * </dl>
1715
     * 
1716
     * @param t1
1717
     *            first item
1718
     * @param t2
1719
     *            second item
1720
     * @param t3
1721
     *            third item
1722
     * @param t4
1723
     *            fourth item
1724
     * @param t5
1725
     *            fifth item
1726
     * @param t6
1727
     *            sixth item
1728
     * @param t7
1729
     *            seventh item
1730
     * @param t8
1731
     *            eighth item
1732
     * @param <T>
1733
     *            the type of these items
1734
     * @return an Observable that emits each item
1735
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1736
     */
1737
    // suppress unchecked because we are using varargs inside the method
1738
    @SuppressWarnings("unchecked")
1739
    public static <T> Observable<T> just(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8) {
1740 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3, t4, t5, t6, t7, t8 });
1741
    }
1742
1743
    /**
1744
     * Converts nine items into an Observable that emits those items.
1745
     * <p>
1746
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1747
     * <dl>
1748
     *  <dt><b>Scheduler:</b></dt>
1749
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1750
     * </dl>
1751
     * 
1752
     * @param t1
1753
     *            first item
1754
     * @param t2
1755
     *            second item
1756
     * @param t3
1757
     *            third item
1758
     * @param t4
1759
     *            fourth item
1760
     * @param t5
1761
     *            fifth item
1762
     * @param t6
1763
     *            sixth item
1764
     * @param t7
1765
     *            seventh item
1766
     * @param t8
1767
     *            eighth item
1768
     * @param t9
1769
     *            ninth item
1770
     * @param <T>
1771
     *            the type of these items
1772
     * @return an Observable that emits each item
1773
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1774
     */
1775
    // suppress unchecked because we are using varargs inside the method
1776
    @SuppressWarnings("unchecked")
1777
    public static <T> Observable<T> just(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8, T t9) {
1778 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3, t4, t5, t6, t7, t8, t9 });
1779
    }
1780
1781
    /**
1782
     * Converts ten items into an Observable that emits those items.
1783
     * <p>
1784
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/just.m.png" alt="">
1785
     * <dl>
1786
     *  <dt><b>Scheduler:</b></dt>
1787
     *  <dd>{@code just} does not operate by default on a particular {@link Scheduler}.</dd>
1788
     * </dl>
1789
     * 
1790
     * @param t1
1791
     *            first item
1792
     * @param t2
1793
     *            second item
1794
     * @param t3
1795
     *            third item
1796
     * @param t4
1797
     *            fourth item
1798
     * @param t5
1799
     *            fifth item
1800
     * @param t6
1801
     *            sixth item
1802
     * @param t7
1803
     *            seventh item
1804
     * @param t8
1805
     *            eighth item
1806
     * @param t9
1807
     *            ninth item
1808
     * @param t10
1809
     *            tenth item
1810
     * @param <T>
1811
     *            the type of these items
1812
     * @return an Observable that emits each item
1813
     * @see <a href="http://reactivex.io/documentation/operators/just.html">ReactiveX operators documentation: Just</a>
1814
     */
1815
    // suppress unchecked because we are using varargs inside the method
1816
    @SuppressWarnings("unchecked")
1817
    public static <T> Observable<T> just(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8, T t9, T t10) {
1818 1 1. just : mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return from((T[])new Object[] { t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 });
1819
    }
1820
    
1821
    /**
1822
     * Flattens an Iterable of Observables into one Observable, without any transformation.
1823
     * <p>
1824
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
1825
     * <p>
1826
     * You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
1827
     * using the {@code merge} method.
1828
     * <dl>
1829
     *  <dt><b>Scheduler:</b></dt>
1830
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
1831
     * </dl>
1832
     * 
1833
     * @param sequences
1834
     *            the Iterable of Observables
1835
     * @return an Observable that emits items that are the result of flattening the items emitted by the
1836
     *         Observables in the Iterable
1837
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
1838
     */
1839
    public static <T> Observable<T> merge(Iterable<? extends Observable<? extends T>> sequences) {
1840 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(from(sequences));
1841
    }
1842
1843
    /**
1844
     * Flattens an Iterable of Observables into one Observable, without any transformation, while limiting the
1845
     * number of concurrent subscriptions to these Observables.
1846
     * <p>
1847
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
1848
     * <p>
1849
     * You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
1850
     * using the {@code merge} method.
1851
     * <dl>
1852
     *  <dt><b>Scheduler:</b></dt>
1853
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
1854
     * </dl>
1855
     * 
1856
     * @param sequences
1857
     *            the Iterable of Observables
1858
     * @param maxConcurrent
1859
     *            the maximum number of Observables that may be subscribed to concurrently
1860
     * @return an Observable that emits items that are the result of flattening the items emitted by the
1861
     *         Observables in the Iterable
1862
     * @throws IllegalArgumentException
1863
     *             if {@code maxConcurrent} is less than or equal to 0
1864
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
1865
     */
1866
    public static <T> Observable<T> merge(Iterable<? extends Observable<? extends T>> sequences, int maxConcurrent) {
1867 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(from(sequences), maxConcurrent);
1868
    }
1869
1870
    /**
1871
     * Flattens an Observable that emits Observables into a single Observable that emits the items emitted by
1872
     * those Observables, without any transformation.
1873
     * <p>
1874
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.oo.png" alt="">
1875
     * <p>
1876
     * You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
1877
     * using the {@code merge} method.
1878
     * <dl>
1879
     *  <dt><b>Scheduler:</b></dt>
1880
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
1881
     * </dl>
1882
     *
1883
     * @param source
1884
     *            an Observable that emits Observables
1885
     * @return an Observable that emits items that are the result of flattening the Observables emitted by the
1886
     *         {@code source} Observable
1887
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
1888
     */
1889
    @SuppressWarnings({"unchecked", "rawtypes"})
1890
    public static <T> Observable<T> merge(Observable<? extends Observable<? extends T>> source) {
1891 1 1. merge : negated conditional → KILLED
        if (source.getClass() == ScalarSynchronousObservable.class) {
1892 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
            return ((ScalarSynchronousObservable<T>)source).scalarFlatMap((Func1)UtilityFunctions.identity());
1893
        }
1894 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return source.lift(OperatorMerge.<T>instance(false));
1895
    }
1896
1897
    /**
1898
     * Flattens an Observable that emits Observables into a single Observable that emits the items emitted by
1899
     * those Observables, without any transformation, while limiting the maximum number of concurrent
1900
     * subscriptions to these Observables.
1901
     * <p>
1902
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.oo.png" alt="">
1903
     * <p>
1904
     * You can combine the items emitted by multiple Observables so that they appear as a single Observable, by
1905
     * using the {@code merge} method.
1906
     * <dl>
1907
     *  <dt><b>Scheduler:</b></dt>
1908
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
1909
     * </dl>
1910
     * 
1911
     * @param source
1912
     *            an Observable that emits Observables
1913
     * @param maxConcurrent
1914
     *            the maximum number of Observables that may be subscribed to concurrently
1915
     * @return an Observable that emits items that are the result of flattening the Observables emitted by the
1916
     *         {@code source} Observable
1917
     * @throws IllegalArgumentException
1918
     *             if {@code maxConcurrent} is less than or equal to 0
1919
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
1920
     * @since 1.1.0
1921
     */
1922
    @SuppressWarnings({"unchecked", "rawtypes"})
1923
    public static <T> Observable<T> merge(Observable<? extends Observable<? extends T>> source, int maxConcurrent) {
1924 1 1. merge : negated conditional → KILLED
        if (source.getClass() == ScalarSynchronousObservable.class) {
1925 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return ((ScalarSynchronousObservable<T>)source).scalarFlatMap((Func1)UtilityFunctions.identity());
1926
        }
1927 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return source.lift(OperatorMerge.<T>instance(false, maxConcurrent));
1928
    }
1929
1930
    /**
1931
     * Flattens two Observables into a single Observable, without any transformation.
1932
     * <p>
1933
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
1934
     * <p>
1935
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
1936
     * using the {@code merge} method.
1937
     * <dl>
1938
     *  <dt><b>Scheduler:</b></dt>
1939
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
1940
     * </dl>
1941
     * 
1942
     * @param t1
1943
     *            an Observable to be merged
1944
     * @param t2
1945
     *            an Observable to be merged
1946
     * @return an Observable that emits all of the items emitted by the source Observables
1947
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
1948
     */
1949
    @SuppressWarnings("unchecked")
1950
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2) {
1951 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(new Observable[] { t1, t2 });
1952
    }
1953
1954
    /**
1955
     * Flattens three Observables into a single Observable, without any transformation.
1956
     * <p>
1957
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
1958
     * <p>
1959
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
1960
     * using the {@code merge} method.
1961
     * <dl>
1962
     *  <dt><b>Scheduler:</b></dt>
1963
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
1964
     * </dl>
1965
     * 
1966
     * @param t1
1967
     *            an Observable to be merged
1968
     * @param t2
1969
     *            an Observable to be merged
1970
     * @param t3
1971
     *            an Observable to be merged
1972
     * @return an Observable that emits all of the items emitted by the source Observables
1973
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
1974
     */
1975
    @SuppressWarnings("unchecked")
1976
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3) {
1977 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(new Observable[] { t1, t2, t3 });
1978
    }
1979
1980
    /**
1981
     * Flattens four Observables into a single Observable, without any transformation.
1982
     * <p>
1983
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
1984
     * <p>
1985
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
1986
     * using the {@code merge} method.
1987
     * <dl>
1988
     *  <dt><b>Scheduler:</b></dt>
1989
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
1990
     * </dl>
1991
     * 
1992
     * @param t1
1993
     *            an Observable to be merged
1994
     * @param t2
1995
     *            an Observable to be merged
1996
     * @param t3
1997
     *            an Observable to be merged
1998
     * @param t4
1999
     *            an Observable to be merged
2000
     * @return an Observable that emits all of the items emitted by the source Observables
2001
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2002
     */
2003
    @SuppressWarnings("unchecked")
2004
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4) {
2005 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(new Observable[] { t1, t2, t3, t4 });
2006
    }
2007
2008
    /**
2009
     * Flattens five Observables into a single Observable, without any transformation.
2010
     * <p>
2011
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
2012
     * <p>
2013
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
2014
     * using the {@code merge} method.
2015
     * <dl>
2016
     *  <dt><b>Scheduler:</b></dt>
2017
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
2018
     * </dl>
2019
     * 
2020
     * @param t1
2021
     *            an Observable to be merged
2022
     * @param t2
2023
     *            an Observable to be merged
2024
     * @param t3
2025
     *            an Observable to be merged
2026
     * @param t4
2027
     *            an Observable to be merged
2028
     * @param t5
2029
     *            an Observable to be merged
2030
     * @return an Observable that emits all of the items emitted by the source Observables
2031
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2032
     */
2033
    @SuppressWarnings("unchecked")
2034
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5) {
2035 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(new Observable[] { t1, t2, t3, t4, t5 });
2036
    }
2037
2038
    /**
2039
     * Flattens six Observables into a single Observable, without any transformation.
2040
     * <p>
2041
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
2042
     * <p>
2043
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
2044
     * using the {@code merge} method.
2045
     * <dl>
2046
     *  <dt><b>Scheduler:</b></dt>
2047
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
2048
     * </dl>
2049
     * 
2050
     * @param t1
2051
     *            an Observable to be merged
2052
     * @param t2
2053
     *            an Observable to be merged
2054
     * @param t3
2055
     *            an Observable to be merged
2056
     * @param t4
2057
     *            an Observable to be merged
2058
     * @param t5
2059
     *            an Observable to be merged
2060
     * @param t6
2061
     *            an Observable to be merged
2062
     * @return an Observable that emits all of the items emitted by the source Observables
2063
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2064
     */
2065
    @SuppressWarnings("unchecked")
2066
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6) {
2067 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(new Observable[] { t1, t2, t3, t4, t5, t6 });
2068
    }
2069
2070
    /**
2071
     * Flattens seven Observables into a single Observable, without any transformation.
2072
     * <p>
2073
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
2074
     * <p>
2075
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
2076
     * using the {@code merge} method.
2077
     * <dl>
2078
     *  <dt><b>Scheduler:</b></dt>
2079
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
2080
     * </dl>
2081
     * 
2082
     * @param t1
2083
     *            an Observable to be merged
2084
     * @param t2
2085
     *            an Observable to be merged
2086
     * @param t3
2087
     *            an Observable to be merged
2088
     * @param t4
2089
     *            an Observable to be merged
2090
     * @param t5
2091
     *            an Observable to be merged
2092
     * @param t6
2093
     *            an Observable to be merged
2094
     * @param t7
2095
     *            an Observable to be merged
2096
     * @return an Observable that emits all of the items emitted by the source Observables
2097
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2098
     */
2099
    @SuppressWarnings("unchecked")
2100
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7) {
2101 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(new Observable[] { t1, t2, t3, t4, t5, t6, t7 });
2102
    }
2103
2104
    /**
2105
     * Flattens eight Observables into a single Observable, without any transformation.
2106
     * <p>
2107
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
2108
     * <p>
2109
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
2110
     * using the {@code merge} method.
2111
     * <dl>
2112
     *  <dt><b>Scheduler:</b></dt>
2113
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
2114
     * </dl>
2115
     * 
2116
     * @param t1
2117
     *            an Observable to be merged
2118
     * @param t2
2119
     *            an Observable to be merged
2120
     * @param t3
2121
     *            an Observable to be merged
2122
     * @param t4
2123
     *            an Observable to be merged
2124
     * @param t5
2125
     *            an Observable to be merged
2126
     * @param t6
2127
     *            an Observable to be merged
2128
     * @param t7
2129
     *            an Observable to be merged
2130
     * @param t8
2131
     *            an Observable to be merged
2132
     * @return an Observable that emits all of the items emitted by the source Observables
2133
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2134
     */
2135
    @SuppressWarnings("unchecked")
2136
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7, Observable<? extends T> t8) {
2137 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(new Observable[] { t1, t2, t3, t4, t5, t6, t7, t8 });
2138
    }
2139
2140
    /**
2141
     * Flattens nine Observables into a single Observable, without any transformation.
2142
     * <p>
2143
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
2144
     * <p>
2145
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
2146
     * using the {@code merge} method.
2147
     * <dl>
2148
     *  <dt><b>Scheduler:</b></dt>
2149
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
2150
     * </dl>
2151
     * 
2152
     * @param t1
2153
     *            an Observable to be merged
2154
     * @param t2
2155
     *            an Observable to be merged
2156
     * @param t3
2157
     *            an Observable to be merged
2158
     * @param t4
2159
     *            an Observable to be merged
2160
     * @param t5
2161
     *            an Observable to be merged
2162
     * @param t6
2163
     *            an Observable to be merged
2164
     * @param t7
2165
     *            an Observable to be merged
2166
     * @param t8
2167
     *            an Observable to be merged
2168
     * @param t9
2169
     *            an Observable to be merged
2170
     * @return an Observable that emits all of the items emitted by the source Observables
2171
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2172
     */
2173
    @SuppressWarnings("unchecked")
2174
    public static <T> Observable<T> merge(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7, Observable<? extends T> t8, Observable<? extends T> t9) {
2175 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(new Observable[] { t1, t2, t3, t4, t5, t6, t7, t8, t9 });
2176
    }
2177
2178
    /**
2179
     * Flattens an Array of Observables into one Observable, without any transformation.
2180
     * <p>
2181
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.io.png" alt="">
2182
     * <p>
2183
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
2184
     * using the {@code merge} method.
2185
     * <dl>
2186
     *  <dt><b>Scheduler:</b></dt>
2187
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
2188
     * </dl>
2189
     * 
2190
     * @param sequences
2191
     *            the Array of Observables
2192
     * @return an Observable that emits all of the items emitted by the Observables in the Array
2193
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2194
     */
2195
    public static <T> Observable<T> merge(Observable<? extends T>[] sequences) {
2196 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(from(sequences));
2197
    }
2198
    
2199
    /**
2200
     * Flattens an Array of Observables into one Observable, without any transformation, while limiting the
2201
     * number of concurrent subscriptions to these Observables.
2202
     * <p>
2203
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.io.png" alt="">
2204
     * <p>
2205
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
2206
     * using the {@code merge} method.
2207
     * <dl>
2208
     *  <dt><b>Scheduler:</b></dt>
2209
     *  <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
2210
     * </dl>
2211
     * 
2212
     * @param sequences
2213
     *            the Array of Observables
2214
     * @param maxConcurrent
2215
     *            the maximum number of Observables that may be subscribed to concurrently
2216
     * @return an Observable that emits all of the items emitted by the Observables in the Array
2217
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2218
     * @since 1.1.0
2219
     */
2220
    public static <T> Observable<T> merge(Observable<? extends T>[] sequences, int maxConcurrent) {
2221 1 1. merge : mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(from(sequences), maxConcurrent);
2222
    }
2223
2224
    /**
2225
     * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
2226
     * receive all successfully emitted items from all of the source Observables without being interrupted by
2227
     * an error notification from one of them.
2228
     * <p>
2229
     * This behaves like {@link #merge(Observable)} except that if any of the merged Observables notify of an
2230
     * error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain from propagating that
2231
     * error notification until all of the merged Observables have finished emitting items.
2232
     * <p>
2233
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2234
     * <p>
2235
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2236
     * invoke the {@code onError} method of its Observers once.
2237
     * <dl>
2238
     *  <dt><b>Scheduler:</b></dt>
2239
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2240
     * </dl>
2241
     * 
2242
     * @param source
2243
     *            an Observable that emits Observables
2244
     * @return an Observable that emits all of the items emitted by the Observables emitted by the
2245
     *         {@code source} Observable
2246
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2247
     */
2248
    public static <T> Observable<T> mergeDelayError(Observable<? extends Observable<? extends T>> source) {
2249 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return source.lift(OperatorMerge.<T>instance(true));
2250
    }
2251
2252
    /**
2253
     * Flattens an Observable that emits Observables into one Observable, in a way that allows an Observer to
2254
     * receive all successfully emitted items from all of the source Observables without being interrupted by
2255
     * an error notification from one of them, while limiting the
2256
     * number of concurrent subscriptions to these Observables.
2257
     * <p>
2258
     * This behaves like {@link #merge(Observable)} except that if any of the merged Observables notify of an
2259
     * error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain from propagating that
2260
     * error notification until all of the merged Observables have finished emitting items.
2261
     * <p>
2262
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2263
     * <p>
2264
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2265
     * invoke the {@code onError} method of its Observers once.
2266
     * <dl>
2267
     *  <dt><b>Scheduler:</b></dt>
2268
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2269
     * </dl>
2270
     * 
2271
     * @param source
2272
     *            an Observable that emits Observables
2273
     * @param maxConcurrent
2274
     *            the maximum number of Observables that may be subscribed to concurrently
2275
     * @return an Observable that emits all of the items emitted by the Observables emitted by the
2276
     *         {@code source} Observable
2277
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2278
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
2279
     */
2280
    @Experimental
2281
    public static <T> Observable<T> mergeDelayError(Observable<? extends Observable<? extends T>> source, int maxConcurrent) {
2282 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return source.lift(OperatorMerge.<T>instance(true, maxConcurrent));
2283
    }
2284
2285
   /**
2286
     * Flattens an Iterable of Observables into one Observable, in a way that allows an Observer to receive all
2287
     * successfully emitted items from each of the source Observables without being interrupted by an error
2288
     * notification from one of them.
2289
     * <p>
2290
     * This behaves like {@link #merge(Observable)} except that if any of the merged Observables notify of an
2291
     * error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain from propagating that
2292
     * error notification until all of the merged Observables have finished emitting items.
2293
     * <p>
2294
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2295
     * <p>
2296
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2297
     * invoke the {@code onError} method of its Observers once.
2298
     * <dl>
2299
     *  <dt><b>Scheduler:</b></dt>
2300
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2301
     * </dl>
2302
     * 
2303
     * @param sequences
2304
     *            the Iterable of Observables
2305
     * @return an Observable that emits items that are the result of flattening the items emitted by the
2306
     *         Observables in the Iterable
2307
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2308
     */
2309
    public static <T> Observable<T> mergeDelayError(Iterable<? extends Observable<? extends T>> sequences) {
2310 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return mergeDelayError(from(sequences));
2311
    }
2312
2313
   /**
2314
     * Flattens an Iterable of Observables into one Observable, in a way that allows an Observer to receive all
2315
     * successfully emitted items from each of the source Observables without being interrupted by an error
2316
     * notification from one of them, while limiting the number of concurrent subscriptions to these Observables.
2317
     * <p>
2318
     * This behaves like {@link #merge(Observable)} except that if any of the merged Observables notify of an
2319
     * error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain from propagating that
2320
     * error notification until all of the merged Observables have finished emitting items.
2321
     * <p>
2322
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2323
     * <p>
2324
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2325
     * invoke the {@code onError} method of its Observers once.
2326
     * <dl>
2327
     *  <dt><b>Scheduler:</b></dt>
2328
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2329
     * </dl>
2330
     * 
2331
     * @param sequences
2332
     *            the Iterable of Observables
2333
     * @param maxConcurrent
2334
     *            the maximum number of Observables that may be subscribed to concurrently
2335
     * @return an Observable that emits items that are the result of flattening the items emitted by the
2336
     *         Observables in the Iterable
2337
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2338
     */
2339
    public static <T> Observable<T> mergeDelayError(Iterable<? extends Observable<? extends T>> sequences, int maxConcurrent) {
2340 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return mergeDelayError(from(sequences), maxConcurrent);
2341
    }
2342
2343
2344
    /**
2345
     * Flattens two Observables into one Observable, in a way that allows an Observer to receive all
2346
     * successfully emitted items from each of the source Observables without being interrupted by an error
2347
     * notification from one of them.
2348
     * <p>
2349
     * This behaves like {@link #merge(Observable, Observable)} except that if any of the merged Observables
2350
     * notify of an error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain from
2351
     * propagating that error notification until all of the merged Observables have finished emitting items.
2352
     * <p>
2353
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2354
     * <p>
2355
     * Even if both merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2356
     * invoke the {@code onError} method of its Observers once.
2357
     * <dl>
2358
     *  <dt><b>Scheduler:</b></dt>
2359
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2360
     * </dl>
2361
     * 
2362
     * @param t1
2363
     *            an Observable to be merged
2364
     * @param t2
2365
     *            an Observable to be merged
2366
     * @return an Observable that emits all of the items that are emitted by the two source Observables
2367
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2368
     */
2369
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2) {
2370 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return mergeDelayError(just(t1, t2));
2371
    }
2372
2373
    /**
2374
     * Flattens three Observables into one Observable, in a way that allows an Observer to receive all
2375
     * successfully emitted items from all of the source Observables without being interrupted by an error
2376
     * notification from one of them.
2377
     * <p>
2378
     * This behaves like {@link #merge(Observable, Observable, Observable)} except that if any of the merged
2379
     * Observables notify of an error via {@link Observer#onError onError}, {@code mergeDelayError} will refrain
2380
     * from propagating that error notification until all of the merged Observables have finished emitting
2381
     * items.
2382
     * <p>
2383
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2384
     * <p>
2385
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2386
     * invoke the {@code onError} method of its Observers once.
2387
     * <dl>
2388
     *  <dt><b>Scheduler:</b></dt>
2389
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2390
     * </dl>
2391
     * 
2392
     * @param t1
2393
     *            an Observable to be merged
2394
     * @param t2
2395
     *            an Observable to be merged
2396
     * @param t3
2397
     *            an Observable to be merged
2398
     * @return an Observable that emits all of the items that are emitted by the source Observables
2399
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2400
     */
2401
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3) {
2402 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return mergeDelayError(just(t1, t2, t3));
2403
    }
2404
2405
    /**
2406
     * Flattens four Observables into one Observable, in a way that allows an Observer to receive all
2407
     * successfully emitted items from all of the source Observables without being interrupted by an error
2408
     * notification from one of them.
2409
     * <p>
2410
     * This behaves like {@link #merge(Observable, Observable, Observable, Observable)} except that if any of
2411
     * the merged Observables notify of an error via {@link Observer#onError onError}, {@code mergeDelayError}
2412
     * will refrain from propagating that error notification until all of the merged Observables have finished
2413
     * emitting items.
2414
     * <p>
2415
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2416
     * <p>
2417
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2418
     * invoke the {@code onError} method of its Observers once.
2419
     * <dl>
2420
     *  <dt><b>Scheduler:</b></dt>
2421
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2422
     * </dl>
2423
     * 
2424
     * @param t1
2425
     *            an Observable to be merged
2426
     * @param t2
2427
     *            an Observable to be merged
2428
     * @param t3
2429
     *            an Observable to be merged
2430
     * @param t4
2431
     *            an Observable to be merged
2432
     * @return an Observable that emits all of the items that are emitted by the source Observables
2433
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2434
     */
2435
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4) {
2436 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return mergeDelayError(just(t1, t2, t3, t4));
2437
    }
2438
2439
    /**
2440
     * Flattens five Observables into one Observable, in a way that allows an Observer to receive all
2441
     * successfully emitted items from all of the source Observables without being interrupted by an error
2442
     * notification from one of them.
2443
     * <p>
2444
     * This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable)} except that
2445
     * if any of the merged Observables notify of an error via {@link Observer#onError onError},
2446
     * {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
2447
     * Observables have finished emitting items.
2448
     * <p>
2449
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2450
     * <p>
2451
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2452
     * invoke the {@code onError} method of its Observers once.
2453
     * <dl>
2454
     *  <dt><b>Scheduler:</b></dt>
2455
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2456
     * </dl>
2457
     * 
2458
     * @param t1
2459
     *            an Observable to be merged
2460
     * @param t2
2461
     *            an Observable to be merged
2462
     * @param t3
2463
     *            an Observable to be merged
2464
     * @param t4
2465
     *            an Observable to be merged
2466
     * @param t5
2467
     *            an Observable to be merged
2468
     * @return an Observable that emits all of the items that are emitted by the source Observables
2469
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2470
     */
2471
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5) {
2472 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return mergeDelayError(just(t1, t2, t3, t4, t5));
2473
    }
2474
2475
    /**
2476
     * Flattens six Observables into one Observable, in a way that allows an Observer to receive all
2477
     * successfully emitted items from all of the source Observables without being interrupted by an error
2478
     * notification from one of them.
2479
     * <p>
2480
     * This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable)}
2481
     * except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
2482
     * {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
2483
     * Observables have finished emitting items.
2484
     * <p>
2485
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2486
     * <p>
2487
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2488
     * invoke the {@code onError} method of its Observers once.
2489
     * <dl>
2490
     *  <dt><b>Scheduler:</b></dt>
2491
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2492
     * </dl>
2493
     * 
2494
     * @param t1
2495
     *            an Observable to be merged
2496
     * @param t2
2497
     *            an Observable to be merged
2498
     * @param t3
2499
     *            an Observable to be merged
2500
     * @param t4
2501
     *            an Observable to be merged
2502
     * @param t5
2503
     *            an Observable to be merged
2504
     * @param t6
2505
     *            an Observable to be merged
2506
     * @return an Observable that emits all of the items that are emitted by the source Observables
2507
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2508
     */
2509
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6) {
2510 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return mergeDelayError(just(t1, t2, t3, t4, t5, t6));
2511
    }
2512
2513
    /**
2514
     * Flattens seven Observables into one Observable, in a way that allows an Observer to receive all
2515
     * successfully emitted items from all of the source Observables without being interrupted by an error
2516
     * notification from one of them.
2517
     * <p>
2518
     * This behaves like
2519
     * {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable, Observable)}
2520
     * except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
2521
     * {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
2522
     * Observables have finished emitting items.
2523
     * <p>
2524
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2525
     * <p>
2526
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2527
     * invoke the {@code onError} method of its Observers once.
2528
     * <dl>
2529
     *  <dt><b>Scheduler:</b></dt>
2530
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2531
     * </dl>
2532
     * 
2533
     * @param t1
2534
     *            an Observable to be merged
2535
     * @param t2
2536
     *            an Observable to be merged
2537
     * @param t3
2538
     *            an Observable to be merged
2539
     * @param t4
2540
     *            an Observable to be merged
2541
     * @param t5
2542
     *            an Observable to be merged
2543
     * @param t6
2544
     *            an Observable to be merged
2545
     * @param t7
2546
     *            an Observable to be merged
2547
     * @return an Observable that emits all of the items that are emitted by the source Observables
2548
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2549
     */
2550
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7) {
2551 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return mergeDelayError(just(t1, t2, t3, t4, t5, t6, t7));
2552
    }
2553
2554
    /**
2555
     * Flattens eight Observables into one Observable, in a way that allows an Observer to receive all
2556
     * successfully emitted items from all of the source Observables without being interrupted by an error
2557
     * notification from one of them.
2558
     * <p>
2559
     * This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable, Observable, Observable)}
2560
     * except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
2561
     * {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
2562
     * Observables have finished emitting items.
2563
     * <p>
2564
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2565
     * <p>
2566
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2567
     * invoke the {@code onError} method of its Observers once.
2568
     * <dl>
2569
     *  <dt><b>Scheduler:</b></dt>
2570
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2571
     * </dl>
2572
     * 
2573
     * @param t1
2574
     *            an Observable to be merged
2575
     * @param t2
2576
     *            an Observable to be merged
2577
     * @param t3
2578
     *            an Observable to be merged
2579
     * @param t4
2580
     *            an Observable to be merged
2581
     * @param t5
2582
     *            an Observable to be merged
2583
     * @param t6
2584
     *            an Observable to be merged
2585
     * @param t7
2586
     *            an Observable to be merged
2587
     * @param t8
2588
     *            an Observable to be merged
2589
     * @return an Observable that emits all of the items that are emitted by the source Observables
2590
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2591
     */
2592
    // suppress because the types are checked by the method signature before using a vararg
2593
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7, Observable<? extends T> t8) {
2594 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return mergeDelayError(just(t1, t2, t3, t4, t5, t6, t7, t8));
2595
    }
2596
2597
    /**
2598
     * Flattens nine Observables into one Observable, in a way that allows an Observer to receive all
2599
     * successfully emitted items from all of the source Observables without being interrupted by an error
2600
     * notification from one of them.
2601
     * <p>
2602
     * This behaves like {@link #merge(Observable, Observable, Observable, Observable, Observable, Observable, Observable, Observable, Observable)}
2603
     * except that if any of the merged Observables notify of an error via {@link Observer#onError onError},
2604
     * {@code mergeDelayError} will refrain from propagating that error notification until all of the merged
2605
     * Observables have finished emitting items.
2606
     * <p>
2607
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeDelayError.png" alt="">
2608
     * <p>
2609
     * Even if multiple merged Observables send {@code onError} notifications, {@code mergeDelayError} will only
2610
     * invoke the {@code onError} method of its Observers once.
2611
     * <dl>
2612
     *  <dt><b>Scheduler:</b></dt>
2613
     *  <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
2614
     * </dl>
2615
     * 
2616
     * @param t1
2617
     *            an Observable to be merged
2618
     * @param t2
2619
     *            an Observable to be merged
2620
     * @param t3
2621
     *            an Observable to be merged
2622
     * @param t4
2623
     *            an Observable to be merged
2624
     * @param t5
2625
     *            an Observable to be merged
2626
     * @param t6
2627
     *            an Observable to be merged
2628
     * @param t7
2629
     *            an Observable to be merged
2630
     * @param t8
2631
     *            an Observable to be merged
2632
     * @param t9
2633
     *            an Observable to be merged
2634
     * @return an Observable that emits all of the items that are emitted by the source Observables
2635
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
2636
     */
2637
    public static <T> Observable<T> mergeDelayError(Observable<? extends T> t1, Observable<? extends T> t2, Observable<? extends T> t3, Observable<? extends T> t4, Observable<? extends T> t5, Observable<? extends T> t6, Observable<? extends T> t7, Observable<? extends T> t8, Observable<? extends T> t9) {
2638 1 1. mergeDelayError : mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return mergeDelayError(just(t1, t2, t3, t4, t5, t6, t7, t8, t9));
2639
    }
2640
2641
    /**
2642
     * Converts the source {@code Observable<T>} into an {@code Observable<Observable<T>>} that emits the
2643
     * source Observable as its single emission.
2644
     * <p>
2645
     * <img width="640" height="350" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/nest.png" alt="">
2646
     * <dl>
2647
     *  <dt><b>Scheduler:</b></dt>
2648
     *  <dd>{@code nest} does not operate by default on a particular {@link Scheduler}.</dd>
2649
     * </dl>
2650
     * 
2651
     * @return an Observable that emits a single item: the source Observable
2652
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
2653
     */
2654
    public final Observable<Observable<T>> nest() {
2655 1 1. nest : mutated return of Object value for rx/Observable::nest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return just(this);
2656
    }
2657
2658
    /**
2659
     * Returns an Observable that never sends any items or notifications to an {@link Observer}.
2660
     * <p>
2661
     * <img width="640" height="185" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/never.png" alt="">
2662
     * <p>
2663
     * This Observable is useful primarily for testing purposes.
2664
     * <dl>
2665
     *  <dt><b>Scheduler:</b></dt>
2666
     *  <dd>{@code never} does not operate by default on a particular {@link Scheduler}.</dd>
2667
     * </dl>
2668
     * 
2669
     * @param <T>
2670
     *            the type of items (not) emitted by the Observable
2671
     * @return an Observable that never emits any items or sends any notifications to an {@link Observer}
2672
     * @see <a href="http://reactivex.io/documentation/operators/empty-never-throw.html">ReactiveX operators documentation: Never</a>
2673
     */
2674
    public static <T> Observable<T> never() {
2675 1 1. never : mutated return of Object value for rx/Observable::never to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return NeverObservable.instance();
2676
    }
2677
2678
    /**
2679
     * Returns an Observable that emits a sequence of Integers within a specified range.
2680
     * <p>
2681
     * <img width="640" height="195" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/range.png" alt="">
2682
     * <dl>
2683
     *  <dt><b>Scheduler:</b></dt>
2684
     *  <dd>{@code range} does not operate by default on a particular {@link Scheduler}.</dd>
2685
     * </dl>
2686
     * 
2687
     * @param start
2688
     *            the value of the first Integer in the sequence
2689
     * @param count
2690
     *            the number of sequential Integers to generate
2691
     * @return an Observable that emits a range of sequential Integers
2692
     * @throws IllegalArgumentException
2693
     *             if {@code count} is less than zero, or if {@code start} + {@code count} &minus; 1 exceeds
2694
     *             {@code Integer.MAX_VALUE}
2695
     * @see <a href="http://reactivex.io/documentation/operators/range.html">ReactiveX operators documentation: Range</a>
2696
     */
2697
    public static Observable<Integer> range(int start, int count) {
2698 2 1. range : changed conditional boundary → KILLED
2. range : negated conditional → KILLED
        if (count < 0) {
2699
            throw new IllegalArgumentException("Count can not be negative");
2700
        }
2701 1 1. range : negated conditional → KILLED
        if (count == 0) {
2702 1 1. range : mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return Observable.empty();
2703
        }
2704 4 1. range : changed conditional boundary → KILLED
2. range : Replaced integer subtraction with addition → KILLED
3. range : Replaced integer addition with subtraction → KILLED
4. range : negated conditional → KILLED
        if (start > Integer.MAX_VALUE - count + 1) {
2705
            throw new IllegalArgumentException("start + count can not exceed Integer.MAX_VALUE");
2706
        }
2707 1 1. range : negated conditional → KILLED
        if(count == 1) {
2708 1 1. range : mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return Observable.just(start);
2709
        }
2710 3 1. range : Replaced integer subtraction with addition → KILLED
2. range : Replaced integer addition with subtraction → KILLED
3. range : mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return Observable.create(new OnSubscribeRange(start, start + (count - 1)));
2711
    }
2712
2713
    /**
2714
     * Returns an Observable that emits a sequence of Integers within a specified range, on a specified
2715
     * Scheduler.
2716
     * <p>
2717
     * <img width="640" height="195" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/range.s.png" alt="">
2718
     * <dl>
2719
     *  <dt><b>Scheduler:</b></dt>
2720
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
2721
     * </dl>
2722
     * 
2723
     * @param start
2724
     *            the value of the first Integer in the sequence
2725
     * @param count
2726
     *            the number of sequential Integers to generate
2727
     * @param scheduler
2728
     *            the Scheduler to run the generator loop on
2729
     * @return an Observable that emits a range of sequential Integers
2730
     * @see <a href="http://reactivex.io/documentation/operators/range.html">ReactiveX operators documentation: Range</a>
2731
     */
2732
    public static Observable<Integer> range(int start, int count, Scheduler scheduler) {
2733 1 1. range : mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return range(start, count).subscribeOn(scheduler);
2734
    }
2735
2736
    /**
2737
     * Returns an Observable that emits a Boolean value that indicates whether two Observable sequences are the
2738
     * same by comparing the items emitted by each Observable pairwise.
2739
     * <p>
2740
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sequenceEqual.png" alt="">
2741
     * <dl>
2742
     *  <dt><b>Scheduler:</b></dt>
2743
     *  <dd>{@code sequenceEqual} does not operate by default on a particular {@link Scheduler}.</dd>
2744
     * </dl>
2745
     * 
2746
     * @param first
2747
     *            the first Observable to compare
2748
     * @param second
2749
     *            the second Observable to compare
2750
     * @param <T>
2751
     *            the type of items emitted by each Observable
2752
     * @return an Observable that emits a Boolean value that indicates whether the two sequences are the same
2753
     * @see <a href="http://reactivex.io/documentation/operators/sequenceequal.html">ReactiveX operators documentation: SequenceEqual</a>
2754
     */
2755
    public static <T> Observable<Boolean> sequenceEqual(Observable<? extends T> first, Observable<? extends T> second) {
2756 1 1. sequenceEqual : mutated return of Object value for rx/Observable::sequenceEqual to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return sequenceEqual(first, second, new Func2<T, T, Boolean>() {
2757
            @Override
2758
            public final Boolean call(T first, T second) {
2759 1 1. call : negated conditional → KILLED
                if (first == null) {
2760 2 1. call : negated conditional → KILLED
2. call : mutated return of Object value for rx/Observable$3::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                    return second == null;
2761
                }
2762 1 1. call : mutated return of Object value for rx/Observable$3::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return first.equals(second);
2763
            }
2764
        });
2765
    }
2766
2767
    /**
2768
     * Returns an Observable that emits a Boolean value that indicates whether two Observable sequences are the
2769
     * same by comparing the items emitted by each Observable pairwise based on the results of a specified
2770
     * equality function.
2771
     * <p>
2772
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sequenceEqual.png" alt="">
2773
     * <dl>
2774
     *  <dt><b>Scheduler:</b></dt>
2775
     *  <dd>{@code sequenceEqual} does not operate by default on a particular {@link Scheduler}.</dd>
2776
     * </dl>
2777
     * 
2778
     * @param first
2779
     *            the first Observable to compare
2780
     * @param second
2781
     *            the second Observable to compare
2782
     * @param equality
2783
     *            a function used to compare items emitted by each Observable
2784
     * @param <T>
2785
     *            the type of items emitted by each Observable
2786
     * @return an Observable that emits a Boolean value that indicates whether the two Observable two sequences
2787
     *         are the same according to the specified function
2788
     * @see <a href="http://reactivex.io/documentation/operators/sequenceequal.html">ReactiveX operators documentation: SequenceEqual</a>
2789
     */
2790
    public static <T> Observable<Boolean> sequenceEqual(Observable<? extends T> first, Observable<? extends T> second, Func2<? super T, ? super T, Boolean> equality) {
2791 1 1. sequenceEqual : mutated return of Object value for rx/Observable::sequenceEqual to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorSequenceEqual.sequenceEqual(first, second, equality);
2792
    }
2793
2794
    /**
2795
     * Converts an Observable that emits Observables into an Observable that emits the items emitted by the
2796
     * most recently emitted of those Observables.
2797
     * <p>
2798
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchDo.png" alt="">
2799
     * <p>
2800
     * {@code switchOnNext} subscribes to an Observable that emits Observables. Each time it observes one of
2801
     * these emitted Observables, the Observable returned by {@code switchOnNext} begins emitting the items
2802
     * emitted by that Observable. When a new Observable is emitted, {@code switchOnNext} stops emitting items
2803
     * from the earlier-emitted Observable and begins emitting items from the new one.
2804
     * <dl>
2805
     *  <dt><b>Scheduler:</b></dt>
2806
     *  <dd>{@code switchOnNext} does not operate by default on a particular {@link Scheduler}.</dd>
2807
     * </dl>
2808
     * 
2809
     * @param <T> the item type
2810
     * @param sequenceOfSequences
2811
     *            the source Observable that emits Observables
2812
     * @return an Observable that emits the items emitted by the Observable most recently emitted by the source
2813
     *         Observable
2814
     * @see <a href="http://reactivex.io/documentation/operators/switch.html">ReactiveX operators documentation: Switch</a>
2815
     */
2816
    public static <T> Observable<T> switchOnNext(Observable<? extends Observable<? extends T>> sequenceOfSequences) {
2817 1 1. switchOnNext : mutated return of Object value for rx/Observable::switchOnNext to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return sequenceOfSequences.lift(OperatorSwitch.<T>instance());
2818
    }
2819
2820
    /**
2821
     * Returns an Observable that emits a {@code 0L} after the {@code initialDelay} and ever increasing numbers
2822
     * after each {@code period} of time thereafter.
2823
     * <p>
2824
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timer.p.png" alt="">
2825
     * <dl>
2826
     *  <dt><b>Backpressure Support:</b></dt>
2827
     *  <dd>This operator does not support backpressure as it uses time. If the downstream needs a slower rate
2828
     *      it should slow the timer or use something like {@link #onBackpressureDrop}.</dd>
2829
     *  <dt><b>Scheduler:</b></dt>
2830
     *  <dd>{@code timer} operates by default on the {@code computation} {@link Scheduler}.</dd>
2831
     * </dl>
2832
     * 
2833
     * @param initialDelay
2834
     *            the initial delay time to wait before emitting the first value of 0L
2835
     * @param period
2836
     *            the period of time between emissions of the subsequent numbers
2837
     * @param unit
2838
     *            the time unit for both {@code initialDelay} and {@code period}
2839
     * @return an Observable that emits a 0L after the {@code initialDelay} and ever increasing numbers after
2840
     *         each {@code period} of time thereafter
2841
     * @see <a href="http://reactivex.io/documentation/operators/timer.html">ReactiveX operators documentation: Timer</a>
2842
     * @deprecated use {@link #interval(long, long, TimeUnit)} instead
2843
     */
2844
    @Deprecated
2845
    public static Observable<Long> timer(long initialDelay, long period, TimeUnit unit) {
2846 1 1. timer : mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return interval(initialDelay, period, unit, Schedulers.computation());
2847
    }
2848
2849
    /**
2850
     * Returns an Observable that emits a {@code 0L} after the {@code initialDelay} and ever increasing numbers
2851
     * after each {@code period} of time thereafter, on a specified {@link Scheduler}.
2852
     * <p>
2853
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timer.ps.png" alt="">
2854
     * <dl>
2855
     *  <dt><b>Backpressure Support:</b></dt>
2856
     *  <dd>This operator does not support backpressure as it uses time. If the downstream needs a slower rate
2857
     *      it should slow the timer or use something like {@link #onBackpressureDrop}.</dd>
2858
     *  <dt><b>Scheduler:</b></dt>
2859
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
2860
     * </dl>
2861
     * 
2862
     * @param initialDelay
2863
     *            the initial delay time to wait before emitting the first value of 0L
2864
     * @param period
2865
     *            the period of time between emissions of the subsequent numbers
2866
     * @param unit
2867
     *            the time unit for both {@code initialDelay} and {@code period}
2868
     * @param scheduler
2869
     *            the Scheduler on which the waiting happens and items are emitted
2870
     * @return an Observable that emits a 0L after the {@code initialDelay} and ever increasing numbers after
2871
     *         each {@code period} of time thereafter, while running on the given Scheduler
2872
     * @see <a href="http://reactivex.io/documentation/operators/timer.html">ReactiveX operators documentation: Timer</a>
2873
     * @deprecated use {@link #interval(long, long, TimeUnit, Scheduler)} instead
2874
     */
2875
    @Deprecated
2876
    public static Observable<Long> timer(long initialDelay, long period, TimeUnit unit, Scheduler scheduler) {
2877 1 1. timer : mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return interval(initialDelay, period, unit, scheduler);
2878
    }
2879
2880
    /**
2881
     * Returns an Observable that emits one item after a specified delay, and then completes.
2882
     * <p>
2883
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timer.png" alt="">
2884
     * <dl>
2885
     *  <dt><b>Backpressure Support:</b></dt>
2886
     *  <dd>This operator does not support backpressure as it uses time. If the downstream needs a slower rate
2887
     *      it should slow the timer or use something like {@link #onBackpressureDrop}.</dd>
2888
     *  <dt><b>Scheduler:</b></dt>
2889
     *  <dd>{@code timer} operates by default on the {@code computation} {@link Scheduler}.</dd>
2890
     * </dl>
2891
     * 
2892
     * @param delay
2893
     *            the initial delay before emitting a single {@code 0L}
2894
     * @param unit
2895
     *            time units to use for {@code delay}
2896
     * @return an Observable that emits one item after a specified delay, and then completes
2897
     * @see <a href="http://reactivex.io/documentation/operators/timer.html">ReactiveX operators documentation: Timer</a>
2898
     */
2899
    public static Observable<Long> timer(long delay, TimeUnit unit) {
2900 1 1. timer : mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → TIMED_OUT
        return timer(delay, unit, Schedulers.computation());
2901
    }
2902
2903
    /**
2904
     * Returns an Observable that emits one item after a specified delay, on a specified Scheduler, and then
2905
     * completes.
2906
     * <p>
2907
     * <img width="640" height="200" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timer.s.png" alt="">
2908
     * <dl>
2909
     *  <dt><b>Backpressure Support:</b></dt>
2910
     *  <dd>This operator does not support backpressure as it uses time. If the downstream needs a slower rate
2911
     *      it should slow the timer or use something like {@link #onBackpressureDrop}.</dd>
2912
     *  <dt><b>Scheduler:</b></dt>
2913
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
2914
     * </dl>
2915
     * 
2916
     * @param delay
2917
     *            the initial delay before emitting a single 0L
2918
     * @param unit
2919
     *            time units to use for {@code delay}
2920
     * @param scheduler
2921
     *            the {@link Scheduler} to use for scheduling the item
2922
     * @return an Observable that emits one item after a specified delay, on a specified Scheduler, and then
2923
     *         completes
2924
     * @see <a href="http://reactivex.io/documentation/operators/timer.html">ReactiveX operators documentation: Timer</a>
2925
     */
2926
    public static Observable<Long> timer(long delay, TimeUnit unit, Scheduler scheduler) {
2927 1 1. timer : mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeTimerOnce(delay, unit, scheduler));
2928
    }
2929
2930
    /**
2931
     * Constructs an Observable that creates a dependent resource object which is disposed of on unsubscription.
2932
     * <p>
2933
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/using.png" alt="">
2934
     * <dl>
2935
     *  <dt><b>Scheduler:</b></dt>
2936
     *  <dd>{@code using} does not operate by default on a particular {@link Scheduler}.</dd>
2937
     * </dl>
2938
     * 
2939
     * @param resourceFactory
2940
     *            the factory function to create a resource object that depends on the Observable
2941
     * @param observableFactory
2942
     *            the factory function to create an Observable
2943
     * @param disposeAction
2944
     *            the function that will dispose of the resource
2945
     * @return the Observable whose lifetime controls the lifetime of the dependent resource object
2946
     * @see <a href="http://reactivex.io/documentation/operators/using.html">ReactiveX operators documentation: Using</a>
2947
     */
2948
    public static <T, Resource> Observable<T> using(
2949
            final Func0<Resource> resourceFactory,
2950
            final Func1<? super Resource, ? extends Observable<? extends T>> observableFactory,
2951
            final Action1<? super Resource> disposeAction) {
2952 1 1. using : mutated return of Object value for rx/Observable::using to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return using(resourceFactory, observableFactory, disposeAction, false);
2953
    }
2954
    
2955
    /**
2956
     * Constructs an Observable that creates a dependent resource object which is disposed of just before 
2957
     * termination if you have set {@code disposeEagerly} to {@code true} and unsubscription does not occur
2958
     * before termination. Otherwise resource disposal will occur on unsubscription.  Eager disposal is
2959
     * particularly appropriate for a synchronous Observable that resuses resources. {@code disposeAction} will
2960
     * only be called once per subscription.
2961
     * <p>
2962
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/using.png" alt="">
2963
     * <dl>
2964
     *  <dt><b>Scheduler:</b></dt>
2965
     *  <dd>{@code using} does not operate by default on a particular {@link Scheduler}.</dd>
2966
     * </dl>
2967
     * 
2968
     * @warn "Backpressure Support" section missing from javadoc
2969
     * @param resourceFactory
2970
     *            the factory function to create a resource object that depends on the Observable
2971
     * @param observableFactory
2972
     *            the factory function to create an Observable
2973
     * @param disposeAction
2974
     *            the function that will dispose of the resource
2975
     * @param disposeEagerly
2976
     *            if {@code true} then disposal will happen either on unsubscription or just before emission of 
2977
     *            a terminal event ({@code onComplete} or {@code onError}).
2978
     * @return the Observable whose lifetime controls the lifetime of the dependent resource object
2979
     * @see <a href="http://reactivex.io/documentation/operators/using.html">ReactiveX operators documentation: Using</a>
2980
     * @Experimental The behavior of this can change at any time.
2981
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
2982
     */
2983
    @Experimental
2984
    public static <T, Resource> Observable<T> using(
2985
            final Func0<Resource> resourceFactory,
2986
            final Func1<? super Resource, ? extends Observable<? extends T>> observableFactory,
2987
            final Action1<? super Resource> disposeAction, boolean disposeEagerly) {
2988 1 1. using : mutated return of Object value for rx/Observable::using to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeUsing<T, Resource>(resourceFactory, observableFactory, disposeAction, disposeEagerly));
2989
    }
2990
2991
    /**
2992
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
2993
     * items emitted, in sequence, by an Iterable of other Observables.
2994
     * <p>
2995
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
2996
     * will be the result of the function applied to the first item emitted by each of the source Observables;
2997
     * the second item emitted by the new Observable will be the result of the function applied to the second
2998
     * item emitted by each of those Observables; and so forth.
2999
     * <p>
3000
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@code onNext} as many times as
3001
     * the number of {@code onNext} invokations of the source Observable that emits the fewest items.
3002
     * <p>
3003
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3004
     * <dl>
3005
     *  <dt><b>Scheduler:</b></dt>
3006
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3007
     * </dl>
3008
     * 
3009
     * @param ws
3010
     *            an Iterable of source Observables
3011
     * @param zipFunction
3012
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3013
     *            an item that will be emitted by the resulting Observable
3014
     * @return an Observable that emits the zipped results
3015
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3016
     */
3017
    public static <R> Observable<R> zip(Iterable<? extends Observable<?>> ws, FuncN<? extends R> zipFunction) {
3018
        List<Observable<?>> os = new ArrayList<Observable<?>>();
3019 1 1. zip : negated conditional → KILLED
        for (Observable<?> o : ws) {
3020
            os.add(o);
3021
        }
3022 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return Observable.just(os.toArray(new Observable<?>[os.size()])).lift(new OperatorZip<R>(zipFunction));
3023
    }
3024
3025
    /**
3026
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3027
     * <i>n</i> items emitted, in sequence, by the <i>n</i> Observables emitted by a specified Observable.
3028
     * <p>
3029
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3030
     * will be the result of the function applied to the first item emitted by each of the Observables emitted
3031
     * by the source Observable; the second item emitted by the new Observable will be the result of the
3032
     * function applied to the second item emitted by each of those Observables; and so forth.
3033
     * <p>
3034
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@code onNext} as many times as
3035
     * the number of {@code onNext} invokations of the source Observable that emits the fewest items.
3036
     * <p>
3037
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.o.png" alt="">
3038
     * <dl>
3039
     *  <dt><b>Scheduler:</b></dt>
3040
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3041
     * </dl>
3042
     * 
3043
     * @param ws
3044
     *            an Observable of source Observables
3045
     * @param zipFunction
3046
     *            a function that, when applied to an item emitted by each of the Observables emitted by
3047
     *            {@code ws}, results in an item that will be emitted by the resulting Observable
3048
     * @return an Observable that emits the zipped results
3049
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3050
     */
3051
    public static <R> Observable<R> zip(Observable<? extends Observable<?>> ws, final FuncN<? extends R> zipFunction) {
3052 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return ws.toList().map(new Func1<List<? extends Observable<?>>, Observable<?>[]>() {
3053
3054
            @Override
3055
            public Observable<?>[] call(List<? extends Observable<?>> o) {
3056 1 1. call : mutated return of Object value for rx/Observable$4::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return o.toArray(new Observable<?>[o.size()]);
3057
            }
3058
3059
        }).lift(new OperatorZip<R>(zipFunction));
3060
    }
3061
3062
    /**
3063
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3064
     * two items emitted, in sequence, by two other Observables.
3065
     * <p>
3066
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3067
     * <p>
3068
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3069
     * will be the result of the function applied to the first item emitted by {@code o1} and the first item
3070
     * emitted by {@code o2}; the second item emitted by the new Observable will be the result of the function
3071
     * applied to the second item emitted by {@code o1} and the second item emitted by {@code o2}; and so forth.
3072
     * <p>
3073
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3074
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3075
     * items.
3076
     * <dl>
3077
     *  <dt><b>Scheduler:</b></dt>
3078
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3079
     * </dl>
3080
     * 
3081
     * @param o1
3082
     *            the first source Observable
3083
     * @param o2
3084
     *            a second source Observable
3085
     * @param zipFunction
3086
     *            a function that, when applied to an item emitted by each of the source Observables, results
3087
     *            in an item that will be emitted by the resulting Observable
3088
     * @return an Observable that emits the zipped results
3089
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3090
     */
3091
    public static <T1, T2, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, final Func2<? super T1, ? super T2, ? extends R> zipFunction) {
3092 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return just(new Observable<?>[] { o1, o2 }).lift(new OperatorZip<R>(zipFunction));
3093
    }
3094
3095
    /**
3096
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3097
     * three items emitted, in sequence, by three other Observables.
3098
     * <p>
3099
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3100
     * <p>
3101
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3102
     * will be the result of the function applied to the first item emitted by {@code o1}, the first item
3103
     * emitted by {@code o2}, and the first item emitted by {@code o3}; the second item emitted by the new
3104
     * Observable will be the result of the function applied to the second item emitted by {@code o1}, the
3105
     * second item emitted by {@code o2}, and the second item emitted by {@code o3}; and so forth.
3106
     * <p>
3107
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3108
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3109
     * items.
3110
     * <dl>
3111
     *  <dt><b>Scheduler:</b></dt>
3112
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3113
     * </dl>
3114
     * 
3115
     * @param o1
3116
     *            the first source Observable
3117
     * @param o2
3118
     *            a second source Observable
3119
     * @param o3
3120
     *            a third source Observable
3121
     * @param zipFunction
3122
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3123
     *            an item that will be emitted by the resulting Observable
3124
     * @return an Observable that emits the zipped results
3125
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3126
     */
3127
    public static <T1, T2, T3, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Func3<? super T1, ? super T2, ? super T3, ? extends R> zipFunction) {
3128 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → TIMED_OUT
        return just(new Observable<?>[] { o1, o2, o3 }).lift(new OperatorZip<R>(zipFunction));
3129
    }
3130
3131
    /**
3132
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3133
     * four items emitted, in sequence, by four other Observables.
3134
     * <p>
3135
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3136
     * <p>
3137
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3138
     * will be the result of the function applied to the first item emitted by {@code o1}, the first item
3139
     * emitted by {@code o2}, the first item emitted by {@code o3}, and the first item emitted by {@code 04};
3140
     * the second item emitted by the new Observable will be the result of the function applied to the second
3141
     * item emitted by each of those Observables; and so forth.
3142
     * <p>
3143
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3144
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3145
     * items.
3146
     * <dl>
3147
     *  <dt><b>Scheduler:</b></dt>
3148
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3149
     * </dl>
3150
     * 
3151
     * @param o1
3152
     *            the first source Observable
3153
     * @param o2
3154
     *            a second source Observable
3155
     * @param o3
3156
     *            a third source Observable
3157
     * @param o4
3158
     *            a fourth source Observable
3159
     * @param zipFunction
3160
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3161
     *            an item that will be emitted by the resulting Observable
3162
     * @return an Observable that emits the zipped results
3163
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3164
     */
3165
    public static <T1, T2, T3, T4, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Func4<? super T1, ? super T2, ? super T3, ? super T4, ? extends R> zipFunction) {
3166 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return just(new Observable<?>[] { o1, o2, o3, o4 }).lift(new OperatorZip<R>(zipFunction));
3167
    }
3168
3169
    /**
3170
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3171
     * five items emitted, in sequence, by five other Observables.
3172
     * <p>
3173
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3174
     * <p>
3175
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3176
     * will be the result of the function applied to the first item emitted by {@code o1}, the first item
3177
     * emitted by {@code o2}, the first item emitted by {@code o3}, the first item emitted by {@code o4}, and
3178
     * the first item emitted by {@code o5}; the second item emitted by the new Observable will be the result of
3179
     * the function applied to the second item emitted by each of those Observables; and so forth.
3180
     * <p>
3181
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3182
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3183
     * items.
3184
     * <dl>
3185
     *  <dt><b>Scheduler:</b></dt>
3186
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3187
     * </dl>
3188
     * 
3189
     * @param o1
3190
     *            the first source Observable
3191
     * @param o2
3192
     *            a second source Observable
3193
     * @param o3
3194
     *            a third source Observable
3195
     * @param o4
3196
     *            a fourth source Observable
3197
     * @param o5
3198
     *            a fifth source Observable
3199
     * @param zipFunction
3200
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3201
     *            an item that will be emitted by the resulting Observable
3202
     * @return an Observable that emits the zipped results
3203
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3204
     */
3205
    public static <T1, T2, T3, T4, T5, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Func5<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? extends R> zipFunction) {
3206 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return just(new Observable<?>[] { o1, o2, o3, o4, o5 }).lift(new OperatorZip<R>(zipFunction));
3207
    }
3208
3209
    /**
3210
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3211
     * six items emitted, in sequence, by six other Observables.
3212
     * <p>
3213
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3214
     * <p>
3215
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3216
     * will be the result of the function applied to the first item emitted by each source Observable, the
3217
     * second item emitted by the new Observable will be the result of the function applied to the second item
3218
     * emitted by each of those Observables, and so forth.
3219
     * <p>
3220
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3221
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3222
     * items.
3223
     * <dl>
3224
     *  <dt><b>Scheduler:</b></dt>
3225
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3226
     * </dl>
3227
     * 
3228
     * @param o1
3229
     *            the first source Observable
3230
     * @param o2
3231
     *            a second source Observable
3232
     * @param o3
3233
     *            a third source Observable
3234
     * @param o4
3235
     *            a fourth source Observable
3236
     * @param o5
3237
     *            a fifth source Observable
3238
     * @param o6
3239
     *            a sixth source Observable
3240
     * @param zipFunction
3241
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3242
     *            an item that will be emitted by the resulting Observable
3243
     * @return an Observable that emits the zipped results
3244
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3245
     */
3246
    public static <T1, T2, T3, T4, T5, T6, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6,
3247
            Func6<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? extends R> zipFunction) {
3248 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return just(new Observable<?>[] { o1, o2, o3, o4, o5, o6 }).lift(new OperatorZip<R>(zipFunction));
3249
    }
3250
3251
    /**
3252
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3253
     * seven items emitted, in sequence, by seven other Observables.
3254
     * <p>
3255
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3256
     * <p>
3257
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3258
     * will be the result of the function applied to the first item emitted by each source Observable, the
3259
     * second item emitted by the new Observable will be the result of the function applied to the second item
3260
     * emitted by each of those Observables, and so forth.
3261
     * <p>
3262
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3263
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3264
     * items.
3265
     * <dl>
3266
     *  <dt><b>Scheduler:</b></dt>
3267
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3268
     * </dl>
3269
     * 
3270
     * @param o1
3271
     *            the first source Observable
3272
     * @param o2
3273
     *            a second source Observable
3274
     * @param o3
3275
     *            a third source Observable
3276
     * @param o4
3277
     *            a fourth source Observable
3278
     * @param o5
3279
     *            a fifth source Observable
3280
     * @param o6
3281
     *            a sixth source Observable
3282
     * @param o7
3283
     *            a seventh source Observable
3284
     * @param zipFunction
3285
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3286
     *            an item that will be emitted by the resulting Observable
3287
     * @return an Observable that emits the zipped results
3288
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3289
     */
3290
    public static <T1, T2, T3, T4, T5, T6, T7, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7,
3291
            Func7<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? extends R> zipFunction) {
3292 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return just(new Observable<?>[] { o1, o2, o3, o4, o5, o6, o7 }).lift(new OperatorZip<R>(zipFunction));
3293
    }
3294
3295
    /**
3296
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3297
     * eight items emitted, in sequence, by eight other Observables.
3298
     * <p>
3299
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3300
     * <p>
3301
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3302
     * will be the result of the function applied to the first item emitted by each source Observable, the
3303
     * second item emitted by the new Observable will be the result of the function applied to the second item
3304
     * emitted by each of those Observables, and so forth.
3305
     * <p>
3306
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3307
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3308
     * items.
3309
     * <dl>
3310
     *  <dt><b>Scheduler:</b></dt>
3311
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3312
     * </dl>
3313
     * 
3314
     * @param o1
3315
     *            the first source Observable
3316
     * @param o2
3317
     *            a second source Observable
3318
     * @param o3
3319
     *            a third source Observable
3320
     * @param o4
3321
     *            a fourth source Observable
3322
     * @param o5
3323
     *            a fifth source Observable
3324
     * @param o6
3325
     *            a sixth source Observable
3326
     * @param o7
3327
     *            a seventh source Observable
3328
     * @param o8
3329
     *            an eighth source Observable
3330
     * @param zipFunction
3331
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3332
     *            an item that will be emitted by the resulting Observable
3333
     * @return an Observable that emits the zipped results
3334
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3335
     */
3336
    public static <T1, T2, T3, T4, T5, T6, T7, T8, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8,
3337
            Func8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R> zipFunction) {
3338 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return just(new Observable<?>[] { o1, o2, o3, o4, o5, o6, o7, o8 }).lift(new OperatorZip<R>(zipFunction));
3339
    }
3340
3341
    /**
3342
     * Returns an Observable that emits the results of a specified combiner function applied to combinations of
3343
     * nine items emitted, in sequence, by nine other Observables.
3344
     * <p>
3345
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
3346
     * <p>
3347
     * {@code zip} applies this function in strict sequence, so the first item emitted by the new Observable
3348
     * will be the result of the function applied to the first item emitted by each source Observable, the
3349
     * second item emitted by the new Observable will be the result of the function applied to the second item
3350
     * emitted by each of those Observables, and so forth.
3351
     * <p>
3352
     * The resulting {@code Observable<R>} returned from {@code zip} will invoke {@link Observer#onNext onNext}
3353
     * as many times as the number of {@code onNext} invocations of the source Observable that emits the fewest
3354
     * items.
3355
     * <dl>
3356
     *  <dt><b>Scheduler:</b></dt>
3357
     *  <dd>{@code zip} does not operate by default on a particular {@link Scheduler}.</dd>
3358
     * </dl>
3359
     * 
3360
     * @param o1
3361
     *            the first source Observable
3362
     * @param o2
3363
     *            a second source Observable
3364
     * @param o3
3365
     *            a third source Observable
3366
     * @param o4
3367
     *            a fourth source Observable
3368
     * @param o5
3369
     *            a fifth source Observable
3370
     * @param o6
3371
     *            a sixth source Observable
3372
     * @param o7
3373
     *            a seventh source Observable
3374
     * @param o8
3375
     *            an eighth source Observable
3376
     * @param o9
3377
     *            a ninth source Observable
3378
     * @param zipFunction
3379
     *            a function that, when applied to an item emitted by each of the source Observables, results in
3380
     *            an item that will be emitted by the resulting Observable
3381
     * @return an Observable that emits the zipped results
3382
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
3383
     */
3384
    public static <T1, T2, T3, T4, T5, T6, T7, T8, T9, R> Observable<R> zip(Observable<? extends T1> o1, Observable<? extends T2> o2, Observable<? extends T3> o3, Observable<? extends T4> o4, Observable<? extends T5> o5, Observable<? extends T6> o6, Observable<? extends T7> o7, Observable<? extends T8> o8,
3385
            Observable<? extends T9> o9, Func9<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? super T9, ? extends R> zipFunction) {
3386 1 1. zip : mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return just(new Observable<?>[] { o1, o2, o3, o4, o5, o6, o7, o8, o9 }).lift(new OperatorZip<R>(zipFunction));
3387
    }
3388
3389
    /**
3390
     * Returns an Observable that emits a Boolean that indicates whether all of the items emitted by the source
3391
     * Observable satisfy a condition.
3392
     * <p>
3393
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/all.png" alt="">
3394
     * <dl>
3395
     *  <dt><b>Scheduler:</b></dt>
3396
     *  <dd>{@code all} does not operate by default on a particular {@link Scheduler}.</dd>
3397
     * </dl>
3398
     * 
3399
     * @param predicate
3400
     *            a function that evaluates an item and returns a Boolean
3401
     * @return an Observable that emits {@code true} if all items emitted by the source Observable satisfy the
3402
     *         predicate; otherwise, {@code false}
3403
     * @see <a href="http://reactivex.io/documentation/operators/all.html">ReactiveX operators documentation: All</a>
3404
     */
3405
    public final Observable<Boolean> all(Func1<? super T, Boolean> predicate) {
3406 1 1. all : mutated return of Object value for rx/Observable::all to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorAll<T>(predicate));
3407
    }
3408
    
3409
    /**
3410
     * Mirrors the Observable (current or provided) that first either emits an item or sends a termination
3411
     * notification.
3412
     * <p>
3413
     * <img width="640" height="385" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/amb.png" alt="">
3414
     * <dl>
3415
     *  <dt><b>Scheduler:</b></dt>
3416
     *  <dd>{@code amb} does not operate by default on a particular {@link Scheduler}.</dd>
3417
     * </dl>
3418
     * 
3419
     * @param t1
3420
     *            an Observable competing to react first
3421
     * @return an Observable that emits the same sequence as whichever of the source Observables first
3422
     *         emitted an item or sent a termination notification
3423
     * @see <a href="http://reactivex.io/documentation/operators/amb.html">ReactiveX operators documentation: Amb</a>
3424
     */
3425
    public final Observable<T> ambWith(Observable<? extends T> t1) {
3426 1 1. ambWith : mutated return of Object value for rx/Observable::ambWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return amb(this, t1);
3427
    }
3428
3429
    /**
3430
     * Portrays a object of an Observable subclass as a simple Observable object. This is useful, for instance,
3431
     * when you have an implementation of a subclass of Observable but you want to hide the properties and
3432
     * methods of this subclass from whomever you are passing the Observable to.
3433
     * <dl>
3434
     *  <dt><b>Scheduler:</b></dt>
3435
     *  <dd>{@code asObservable} does not operate by default on a particular {@link Scheduler}.</dd>
3436
     * </dl>
3437
     * 
3438
     * @return an Observable that hides the identity of this Observable
3439
     */
3440
    public final Observable<T> asObservable() {
3441 1 1. asObservable : mutated return of Object value for rx/Observable::asObservable to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorAsObservable.<T>instance());
3442
    }
3443
3444
    /**
3445
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3446
     * Observable emits connected, non-overlapping buffers. It emits the current buffer and replaces it with a
3447
     * new buffer whenever the Observable produced by the specified {@code bufferClosingSelector} emits an item.
3448
     * <p>
3449
     * <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer1.png" alt="">
3450
     * <dl>
3451
     *  <dt><b>Backpressure Support:</b></dt>
3452
     *  <dd>This operator does not support backpressure as it is instead controlled by the given Observables and
3453
     *      buffers data. It requests {@code Long.MAX_VALUE} upstream and does not obey downstream requests.</dd>
3454
     *  <dt><b>Scheduler:</b></dt>
3455
     *  <dd>This version of {@code buffer} does not operate by default on a particular {@link Scheduler}.</dd>
3456
     * </dl>
3457
     * 
3458
     * @param bufferClosingSelector
3459
     *            a {@link Func0} that produces an Observable that governs the boundary between buffers.
3460
     *            Whenever this {@code Observable} emits an item, {@code buffer} emits the current buffer and
3461
     *            begins to fill a new one
3462
     * @return an Observable that emits a connected, non-overlapping buffer of items from the source Observable
3463
     *         each time the Observable created with the {@code bufferClosingSelector} argument emits an item
3464
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3465
     */
3466
    public final <TClosing> Observable<List<T>> buffer(Func0<? extends Observable<? extends TClosing>> bufferClosingSelector) {
3467 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorBufferWithSingleObservable<T, TClosing>(bufferClosingSelector, 16));
3468
    }
3469
3470
    /**
3471
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3472
     * Observable emits connected, non-overlapping buffers, each containing {@code count} items. When the source
3473
     * Observable completes or encounters an error, the resulting Observable emits the current buffer and
3474
     * propagates the notification from the source Observable.
3475
     * <p>
3476
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer3.png" alt="">
3477
     * <dl>
3478
     *  <dt><b>Scheduler:</b></dt>
3479
     *  <dd>This version of {@code buffer} does not operate by default on a particular {@link Scheduler}.</dd>
3480
     * </dl>
3481
     * 
3482
     * @param count
3483
     *            the maximum number of items in each buffer before it should be emitted
3484
     * @return an Observable that emits connected, non-overlapping buffers, each containing at most
3485
     *         {@code count} items from the source Observable
3486
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3487
     */
3488
    public final Observable<List<T>> buffer(int count) {
3489 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return buffer(count, count);
3490
    }
3491
3492
    /**
3493
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3494
     * Observable emits buffers every {@code skip} items, each containing {@code count} items. When the source
3495
     * Observable completes or encounters an error, the resulting Observable emits the current buffer and
3496
     * propagates the notification from the source Observable.
3497
     * <p>
3498
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer4.png" alt="">
3499
     * <dl>
3500
     *  <dt><b>Scheduler:</b></dt>
3501
     *  <dd>This version of {@code buffer} does not operate by default on a particular {@link Scheduler}.</dd>
3502
     * </dl>
3503
     * 
3504
     * @param count
3505
     *            the maximum size of each buffer before it should be emitted
3506
     * @param skip
3507
     *            how many items emitted by the source Observable should be skipped before starting a new
3508
     *            buffer. Note that when {@code skip} and {@code count} are equal, this is the same operation as
3509
     *            {@link #buffer(int)}.
3510
     * @return an Observable that emits buffers for every {@code skip} item from the source Observable and
3511
     *         containing at most {@code count} items
3512
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3513
     */
3514
    public final Observable<List<T>> buffer(int count, int skip) {
3515 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorBufferWithSize<T>(count, skip));
3516
    }
3517
3518
    /**
3519
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3520
     * Observable starts a new buffer periodically, as determined by the {@code timeshift} argument. It emits
3521
     * each buffer after a fixed timespan, specified by the {@code timespan} argument. When the source
3522
     * Observable completes or encounters an error, the resulting Observable emits the current buffer and
3523
     * propagates the notification from the source Observable.
3524
     * <p>
3525
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer7.png" alt="">
3526
     * <dl>
3527
     *  <dt><b>Backpressure Support:</b></dt>
3528
     *  <dd>This operator does not support backpressure as it uses time. It requests {@code Long.MAX_VALUE}
3529
     *      upstream and does not obey downstream requests.</dd>
3530
     *  <dt><b>Scheduler:</b></dt>
3531
     *  <dd>This version of {@code buffer} operates by default on the {@code computation} {@link Scheduler}.</dd>
3532
     * </dl>
3533
     * 
3534
     * @param timespan
3535
     *            the period of time each buffer collects items before it is emitted
3536
     * @param timeshift
3537
     *            the period of time after which a new buffer will be created
3538
     * @param unit
3539
     *            the unit of time that applies to the {@code timespan} and {@code timeshift} arguments
3540
     * @return an Observable that emits new buffers of items emitted by the source Observable periodically after
3541
     *         a fixed timespan has elapsed
3542
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3543
     */
3544
    public final Observable<List<T>> buffer(long timespan, long timeshift, TimeUnit unit) {
3545 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return buffer(timespan, timeshift, unit,  Schedulers.computation());
3546
    }
3547
3548
    /**
3549
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3550
     * Observable starts a new buffer periodically, as determined by the {@code timeshift} argument, and on the
3551
     * specified {@code scheduler}. It emits each buffer after a fixed timespan, specified by the
3552
     * {@code timespan} argument. When the source Observable completes or encounters an error, the resulting
3553
     * Observable emits the current buffer and propagates the notification from the source Observable.
3554
     * <p>
3555
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer7.s.png" alt="">
3556
     * <dl>
3557
     *  <dt><b>Backpressure Support:</b></dt>
3558
     *  <dd>This operator does not support backpressure as it uses time. It requests {@code Long.MAX_VALUE}
3559
     *      upstream and does not obey downstream requests.</dd>
3560
     *  <dt><b>Scheduler:</b></dt>
3561
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
3562
     * </dl>
3563
     * 
3564
     * @param timespan
3565
     *            the period of time each buffer collects items before it is emitted
3566
     * @param timeshift
3567
     *            the period of time after which a new buffer will be created
3568
     * @param unit
3569
     *            the unit of time that applies to the {@code timespan} and {@code timeshift} arguments
3570
     * @param scheduler
3571
     *            the {@link Scheduler} to use when determining the end and start of a buffer
3572
     * @return an Observable that emits new buffers of items emitted by the source Observable periodically after
3573
     *         a fixed timespan has elapsed
3574
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3575
     */
3576
    public final Observable<List<T>> buffer(long timespan, long timeshift, TimeUnit unit, Scheduler scheduler) {
3577 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorBufferWithTime<T>(timespan, timeshift, unit, Integer.MAX_VALUE, scheduler));
3578
    }
3579
3580
    /**
3581
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3582
     * Observable emits connected, non-overlapping buffers, each of a fixed duration specified by the
3583
     * {@code timespan} argument. When the source Observable completes or encounters an error, the resulting
3584
     * Observable emits the current buffer and propagates the notification from the source Observable.
3585
     * <p>
3586
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer5.png" alt="">
3587
     * <dl>
3588
     *  <dt><b>Backpressure Support:</b></dt>
3589
     *  <dd>This operator does not support backpressure as it uses time. It requests {@code Long.MAX_VALUE}
3590
     *      upstream and does not obey downstream requests.</dd>
3591
     *  <dt><b>Scheduler:</b></dt>
3592
     *  <dd>This version of {@code buffer} operates by default on the {@code computation} {@link Scheduler}.</dd>
3593
     * </dl>
3594
     * 
3595
     * @param timespan
3596
     *            the period of time each buffer collects items before it is emitted and replaced with a new
3597
     *            buffer
3598
     * @param unit
3599
     *            the unit of time that applies to the {@code timespan} argument
3600
     * @return an Observable that emits connected, non-overlapping buffers of items emitted by the source
3601
     *         Observable within a fixed duration
3602
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3603
     */
3604
    public final Observable<List<T>> buffer(long timespan, TimeUnit unit) {
3605 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return buffer(timespan, unit, Integer.MAX_VALUE, Schedulers.computation());
3606
    }
3607
3608
    /**
3609
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3610
     * Observable emits connected, non-overlapping buffers, each of a fixed duration specified by the
3611
     * {@code timespan} argument or a maximum size specified by the {@code count} argument (whichever is reached
3612
     * first). When the source Observable completes or encounters an error, the resulting Observable emits the
3613
     * current buffer and propagates the notification from the source Observable.
3614
     * <p>
3615
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer6.png" alt="">
3616
     * <dl>
3617
     *  <dt><b>Backpressure Support:</b></dt>
3618
     *  <dd>This operator does not support backpressure as it uses time. It requests {@code Long.MAX_VALUE}
3619
     *      upstream and does not obey downstream requests.</dd>
3620
     *  <dt><b>Scheduler:</b></dt>
3621
     *  <dd>This version of {@code buffer} operates by default on the {@code computation} {@link Scheduler}.</dd>
3622
     * </dl>
3623
     * 
3624
     * @param timespan
3625
     *            the period of time each buffer collects items before it is emitted and replaced with a new
3626
     *            buffer
3627
     * @param unit
3628
     *            the unit of time which applies to the {@code timespan} argument
3629
     * @param count
3630
     *            the maximum size of each buffer before it is emitted
3631
     * @return an Observable that emits connected, non-overlapping buffers of items emitted by the source
3632
     *         Observable, after a fixed duration or when the buffer reaches maximum capacity (whichever occurs
3633
     *         first)
3634
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3635
     */
3636
    public final Observable<List<T>> buffer(long timespan, TimeUnit unit, int count) {
3637 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorBufferWithTime<T>(timespan, timespan, unit, count, Schedulers.computation()));
3638
    }
3639
3640
    /**
3641
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3642
     * Observable emits connected, non-overlapping buffers, each of a fixed duration specified by the
3643
     * {@code timespan} argument as measured on the specified {@code scheduler}, or a maximum size specified by
3644
     * the {@code count} argument (whichever is reached first). When the source Observable completes or
3645
     * encounters an error, the resulting Observable emits the current buffer and propagates the notification
3646
     * from the source Observable.
3647
     * <p>
3648
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer6.s.png" alt="">
3649
     * <dl>
3650
     *  <dt><b>Backpressure Support:</b></dt>
3651
     *  <dd>This operator does not support backpressure as it uses time. It requests {@code Long.MAX_VALUE}
3652
     *      upstream and does not obey downstream requests.</dd>
3653
     *  <dt><b>Scheduler:</b></dt>
3654
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
3655
     * </dl>
3656
     * 
3657
     * @param timespan
3658
     *            the period of time each buffer collects items before it is emitted and replaced with a new
3659
     *            buffer
3660
     * @param unit
3661
     *            the unit of time which applies to the {@code timespan} argument
3662
     * @param count
3663
     *            the maximum size of each buffer before it is emitted
3664
     * @param scheduler
3665
     *            the {@link Scheduler} to use when determining the end and start of a buffer
3666
     * @return an Observable that emits connected, non-overlapping buffers of items emitted by the source
3667
     *         Observable after a fixed duration or when the buffer reaches maximum capacity (whichever occurs
3668
     *         first)
3669
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3670
     */
3671
    public final Observable<List<T>> buffer(long timespan, TimeUnit unit, int count, Scheduler scheduler) {
3672 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorBufferWithTime<T>(timespan, timespan, unit, count, scheduler));
3673
    }
3674
3675
    /**
3676
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3677
     * Observable emits connected, non-overlapping buffers, each of a fixed duration specified by the
3678
     * {@code timespan} argument and on the specified {@code scheduler}. When the source Observable completes or
3679
     * encounters an error, the resulting Observable emits the current buffer and propagates the notification
3680
     * from the source Observable.
3681
     * <p>
3682
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer5.s.png" alt="">
3683
     * <dl>
3684
     *  <dt><b>Backpressure Support:</b></dt>
3685
     *  <dd>This operator does not support backpressure as it uses time. It requests {@code Long.MAX_VALUE}
3686
     *      upstream and does not obey downstream requests.</dd>
3687
     *  <dt><b>Scheduler:</b></dt>
3688
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
3689
     * </dl>
3690
     * 
3691
     * @param timespan
3692
     *            the period of time each buffer collects items before it is emitted and replaced with a new
3693
     *            buffer
3694
     * @param unit
3695
     *            the unit of time which applies to the {@code timespan} argument
3696
     * @param scheduler
3697
     *            the {@link Scheduler} to use when determining the end and start of a buffer
3698
     * @return an Observable that emits connected, non-overlapping buffers of items emitted by the source
3699
     *         Observable within a fixed duration
3700
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3701
     */
3702
    public final Observable<List<T>> buffer(long timespan, TimeUnit unit, Scheduler scheduler) {
3703 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return buffer(timespan, timespan, unit, scheduler);
3704
    }
3705
3706
    /**
3707
     * Returns an Observable that emits buffers of items it collects from the source Observable. The resulting
3708
     * Observable emits buffers that it creates when the specified {@code bufferOpenings} Observable emits an
3709
     * item, and closes when the Observable returned from {@code bufferClosingSelector} emits an item.
3710
     * <p>
3711
     * <img width="640" height="470" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer2.png" alt="">
3712
     * <dl>
3713
     *  <dt><b>Backpressure Support:</b></dt>
3714
     *  <dd>This operator does not support backpressure as it is instead controlled by the given Observables and
3715
     *      buffers data. It requests {@code Long.MAX_VALUE} upstream and does not obey downstream requests.</dd>
3716
     *  <dt><b>Scheduler:</b></dt>
3717
     *  <dd>This version of {@code buffer} does not operate by default on a particular {@link Scheduler}.</dd>
3718
     * </dl>
3719
     * 
3720
     * @param bufferOpenings
3721
     *            the Observable that, when it emits an item, causes a new buffer to be created
3722
     * @param bufferClosingSelector
3723
     *            the {@link Func1} that is used to produce an Observable for every buffer created. When this
3724
     *            Observable emits an item, the associated buffer is emitted.
3725
     * @return an Observable that emits buffers, containing items from the source Observable, that are created
3726
     *         and closed when the specified Observables emit items
3727
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3728
     */
3729
    public final <TOpening, TClosing> Observable<List<T>> buffer(Observable<? extends TOpening> bufferOpenings, Func1<? super TOpening, ? extends Observable<? extends TClosing>> bufferClosingSelector) {
3730 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorBufferWithStartEndObservable<T, TOpening, TClosing>(bufferOpenings, bufferClosingSelector));
3731
    }
3732
3733
    /**
3734
     * Returns an Observable that emits non-overlapping buffered items from the source Observable each time the
3735
     * specified boundary Observable emits an item.
3736
     * <p>
3737
     * <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer8.png" alt="">
3738
     * <p>
3739
     * Completion of either the source or the boundary Observable causes the returned Observable to emit the
3740
     * latest buffer and complete.
3741
     * <dl>
3742
     *  <dt><b>Backpressure Support:</b></dt>
3743
     *  <dd>This operator does not support backpressure as it is instead controlled by the {@code Observable}
3744
     *      {@code boundary} and buffers data. It requests {@code Long.MAX_VALUE} upstream and does not obey
3745
     *      downstream requests.</dd>
3746
     *  <dt><b>Scheduler:</b></dt>
3747
     *  <dd>This version of {@code buffer} does not operate by default on a particular {@link Scheduler}.</dd>
3748
     * </dl>
3749
     * 
3750
     * @param <B>
3751
     *            the boundary value type (ignored)
3752
     * @param boundary
3753
     *            the boundary Observable
3754
     * @return an Observable that emits buffered items from the source Observable when the boundary Observable
3755
     *         emits an item
3756
     * @see #buffer(rx.Observable, int)
3757
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3758
     */
3759
    public final <B> Observable<List<T>> buffer(Observable<B> boundary) {
3760 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return buffer(boundary, 16);
3761
    }
3762
3763
    /**
3764
     * Returns an Observable that emits non-overlapping buffered items from the source Observable each time the
3765
     * specified boundary Observable emits an item.
3766
     * <p>
3767
     * <img width="640" height="395" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/buffer8.png" alt="">
3768
     * <p>
3769
     * Completion of either the source or the boundary Observable causes the returned Observable to emit the
3770
     * latest buffer and complete.
3771
     * <dl>
3772
     *  <dt><b>Backpressure Support:</b></dt>
3773
     *  <dd>This operator does not support backpressure as it is instead controlled by the {@code Observable}
3774
     *      {@code boundary} and buffers data. It requests {@code Long.MAX_VALUE} upstream and does not obey
3775
     *      downstream requests.</dd>
3776
     *  <dt><b>Scheduler:</b></dt>
3777
     *  <dd>This version of {@code buffer} does not operate by default on a particular {@link Scheduler}.</dd>
3778
     * </dl>
3779
     * 
3780
     * @param <B>
3781
     *            the boundary value type (ignored)
3782
     * @param boundary
3783
     *            the boundary Observable
3784
     * @param initialCapacity
3785
     *            the initial capacity of each buffer chunk
3786
     * @return an Observable that emits buffered items from the source Observable when the boundary Observable
3787
     *         emits an item
3788
     * @see <a href="http://reactivex.io/documentation/operators/buffer.html">ReactiveX operators documentation: Buffer</a>
3789
     * @see #buffer(rx.Observable, int)
3790
     */
3791
    public final <B> Observable<List<T>> buffer(Observable<B> boundary, int initialCapacity) {
3792 1 1. buffer : mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorBufferWithSingleObservable<T, B>(boundary, initialCapacity));
3793
    }
3794
3795
    /**
3796
     * Caches the emissions from the source Observable and replays them in order to any subsequent Subscribers.
3797
     * This method has similar behavior to {@link #replay} except that this auto-subscribes to the source
3798
     * Observable rather than returning a {@link ConnectableObservable} for which you must call
3799
     * {@code connect} to activate the subscription.
3800
     * <p>
3801
     * <img width="640" height="410" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/cache.png" alt="">
3802
     * <p>
3803
     * This is useful when you want an Observable to cache responses and you can't control the
3804
     * subscribe/unsubscribe behavior of all the {@link Subscriber}s.
3805
     * <p>
3806
     * When you call {@code cache}, it does not yet subscribe to the source Observable and so does not yet
3807
     * begin cacheing items. This only happens when the first Subscriber calls the resulting Observable's
3808
     * {@code subscribe} method.
3809
     * <p>
3810
     * <em>Note:</em> You sacrifice the ability to unsubscribe from the origin when you use the {@code cache}
3811
     * Observer so be careful not to use this Observer on Observables that emit an infinite or very large number
3812
     * of items that will use up memory.
3813
     * <dl>
3814
     *  <dt><b>Backpressure Support:</b></dt>
3815
     *  <dd>This operator does not support upstream backpressure as it is purposefully requesting and caching
3816
     *      everything emitted.</dd>
3817
     *  <dt><b>Scheduler:</b></dt>
3818
     *  <dd>{@code cache} does not operate by default on a particular {@link Scheduler}.</dd>
3819
     * </dl>
3820
     * 
3821
     * @return an Observable that, when first subscribed to, caches all of its items and notifications for the
3822
     *         benefit of subsequent subscribers
3823
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
3824
     */
3825
    public final Observable<T> cache() {
3826 1 1. cache : mutated return of Object value for rx/Observable::cache to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return CachedObservable.from(this);
3827
    }
3828
3829
    /**
3830
     * @see #cacheWithInitialCapacity(int)
3831
     * @deprecated Use {@link #cacheWithInitialCapacity(int)} instead.
3832
     */
3833
    @Deprecated
3834
    public final Observable<T> cache(int initialCapacity) {
3835 1 1. cache : mutated return of Object value for rx/Observable::cache to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return cacheWithInitialCapacity(initialCapacity);
3836
    }
3837
3838
    /**
3839
     * Caches emissions from the source Observable and replays them in order to any subsequent Subscribers.
3840
     * This method has similar behavior to {@link #replay} except that this auto-subscribes to the source
3841
     * Observable rather than returning a {@link ConnectableObservable} for which you must call
3842
     * {@code connect} to activate the subscription.
3843
     * <p>
3844
     * <img width="640" height="410" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/cache.png" alt="">
3845
     * <p>
3846
     * This is useful when you want an Observable to cache responses and you can't control the
3847
     * subscribe/unsubscribe behavior of all the {@link Subscriber}s.
3848
     * <p>
3849
     * When you call {@code cache}, it does not yet subscribe to the source Observable and so does not yet
3850
     * begin cacheing items. This only happens when the first Subscriber calls the resulting Observable's
3851
     * {@code subscribe} method.
3852
     * <p>
3853
     * <em>Note:</em> You sacrifice the ability to unsubscribe from the origin when you use the {@code cache}
3854
     * Observer so be careful not to use this Observer on Observables that emit an infinite or very large number
3855
     * of items that will use up memory.
3856
     * <dl>
3857
     *  <dt><b>Backpressure Support:</b></dt>
3858
     *  <dd>This operator does not support upstream backpressure as it is purposefully requesting and caching
3859
     *      everything emitted.</dd>
3860
     *  <dt><b>Scheduler:</b></dt>
3861
     *  <dd>{@code cache} does not operate by default on a particular {@link Scheduler}.</dd>
3862
     * </dl>
3863
     * <p>
3864
     * <em>Note:</em> The capacity hint is not an upper bound on cache size. For that, consider
3865
     * {@link #replay(int)} in combination with {@link ConnectableObservable#autoConnect()} or similar.
3866
     * 
3867
     * @param initialCapacity hint for number of items to cache (for optimizing underlying data structure)
3868
     * @return an Observable that, when first subscribed to, caches all of its items and notifications for the
3869
     *         benefit of subsequent subscribers
3870
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
3871
     */
3872
    public final Observable<T> cacheWithInitialCapacity(int initialCapacity) {
3873 1 1. cacheWithInitialCapacity : mutated return of Object value for rx/Observable::cacheWithInitialCapacity to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return CachedObservable.from(this, initialCapacity);
3874
    }
3875
3876
    /**
3877
     * Returns an Observable that emits the items emitted by the source Observable, converted to the specified
3878
     * type.
3879
     * <p>
3880
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/cast.png" alt="">
3881
     * <dl>
3882
     *  <dt><b>Scheduler:</b></dt>
3883
     *  <dd>{@code cast} does not operate by default on a particular {@link Scheduler}.</dd>
3884
     * </dl>
3885
     * 
3886
     * @param klass
3887
     *            the target class type that {@code cast} will cast the items emitted by the source Observable
3888
     *            into before emitting them from the resulting Observable
3889
     * @return an Observable that emits each item from the source Observable after converting it to the
3890
     *         specified type
3891
     * @see <a href="http://reactivex.io/documentation/operators/map.html">ReactiveX operators documentation: Map</a>
3892
     */
3893
    public final <R> Observable<R> cast(final Class<R> klass) {
3894 1 1. cast : mutated return of Object value for rx/Observable::cast to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorCast<T, R>(klass));
3895
    }
3896
3897
    /**
3898
     * Collects items emitted by the source Observable into a single mutable data structure and returns an
3899
     * Observable that emits this structure.
3900
     * <p>
3901
     * <img width="640" height="330" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/collect.png" alt="">
3902
     * <p>
3903
     * This is a simplified version of {@code reduce} that does not need to return the state on each pass.
3904
     * <dl>
3905
     *  <dt><b>Backpressure Support:</b></dt>
3906
     *  <dd>This operator does not support backpressure because by intent it will receive all values and reduce
3907
     *      them to a single {@code onNext}.</dd>
3908
     *  <dt><b>Scheduler:</b></dt>
3909
     *  <dd>{@code collect} does not operate by default on a particular {@link Scheduler}.</dd>
3910
     * </dl>
3911
     * 
3912
     * @param stateFactory
3913
     *           the mutable data structure that will collect the items
3914
     * @param collector
3915
     *           a function that accepts the {@code state} and an emitted item, and modifies {@code state}
3916
     *           accordingly
3917
     * @return an Observable that emits the result of collecting the values emitted by the source Observable
3918
     *         into a single mutable data structure
3919
     * @see <a href="http://reactivex.io/documentation/operators/reduce.html">ReactiveX operators documentation: Reduce</a>
3920
     */
3921
    public final <R> Observable<R> collect(Func0<R> stateFactory, final Action2<R, ? super T> collector) {
3922
        Func2<R, T, R> accumulator = new Func2<R, T, R>() {
3923
3924
            @Override
3925
            public final R call(R state, T value) {
3926 1 1. call : removed call to rx/functions/Action2::call → KILLED
                collector.call(state, value);
3927 1 1. call : mutated return of Object value for rx/Observable$5::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return state;
3928
            }
3929
3930
        };
3931
        
3932
        /*
3933
         * Discussion and confirmation of implementation at
3934
         * https://github.com/ReactiveX/RxJava/issues/423#issuecomment-27642532
3935
         * 
3936
         * It should use last() not takeLast(1) since it needs to emit an error if the sequence is empty.
3937
         */
3938 1 1. collect : mutated return of Object value for rx/Observable::collect to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorScan<R, T>(stateFactory, accumulator)).last();
3939
    }
3940
3941
    /**
3942
     * Returns a new Observable that emits items resulting from applying a function that you supply to each item
3943
     * emitted by the source Observable, where that function returns an Observable, and then emitting the items
3944
     * that result from concatenating those resulting Observables.
3945
     * <p>
3946
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concatMap.png" alt="">
3947
     * <dl>
3948
     *  <dt><b>Scheduler:</b></dt>
3949
     *  <dd>{@code concatMap} does not operate by default on a particular {@link Scheduler}.</dd>
3950
     * </dl>
3951
     * 
3952
     * @param func
3953
     *            a function that, when applied to an item emitted by the source Observable, returns an
3954
     *            Observable
3955
     * @return an Observable that emits the result of applying the transformation function to each item emitted
3956
     *         by the source Observable and concatenating the Observables obtained from this transformation
3957
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
3958
     */
3959
    public final <R> Observable<R> concatMap(Func1<? super T, ? extends Observable<? extends R>> func) {
3960 1 1. concatMap : mutated return of Object value for rx/Observable::concatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concat(map(func));
3961
    }
3962
    
3963
    /**
3964
     * Returns an Observable that concatenate each item emitted by the source Observable with the values in an
3965
     * Iterable corresponding to that item that is generated by a selector.
3966
     * <p>
3967
     * 
3968
     * <dl>
3969
     *  <dt><b>Scheduler:</b></dt>
3970
     *  <dd>{@code concatMapIterable} does not operate by default on a particular {@link Scheduler}.</dd>
3971
     * </dl>
3972
     * 
3973
     * @param <R>
3974
     *            the type of item emitted by the resulting Observable
3975
     * @param collectionSelector
3976
     *            a function that returns an Iterable sequence of values for when given an item emitted by the
3977
     *            source Observable
3978
     * @return an Observable that emits the results of concatenating the items emitted by the source Observable with
3979
     *         the values in the Iterables corresponding to those items, as generated by {@code collectionSelector}
3980
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
3981
     */
3982
    public final <R> Observable<R> concatMapIterable(Func1<? super T, ? extends Iterable<? extends R>> collectionSelector) {
3983 1 1. concatMapIterable : mutated return of Object value for rx/Observable::concatMapIterable to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concat(map(OperatorMapPair.convertSelector(collectionSelector)));
3984
    }
3985
    
3986
    /**
3987
     * Returns an Observable that emits the items emitted from the current Observable, then the next, one after
3988
     * the other, without interleaving them.
3989
     * <p>
3990
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concat.png" alt="">
3991
     * <dl>
3992
     *  <dt><b>Scheduler:</b></dt>
3993
     *  <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
3994
     * </dl>
3995
     * 
3996
     * @param t1
3997
     *            an Observable to be concatenated after the current
3998
     * @return an Observable that emits items emitted by the two source Observables, one after the other,
3999
     *         without interleaving them
4000
     * @see <a href="http://reactivex.io/documentation/operators/concat.html">ReactiveX operators documentation: Concat</a>
4001
     */
4002
    public final Observable<T> concatWith(Observable<? extends T> t1) {
4003 1 1. concatWith : mutated return of Object value for rx/Observable::concatWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concat(this, t1);
4004
    }
4005
4006
    /**
4007
     * Returns an Observable that emits a Boolean that indicates whether the source Observable emitted a
4008
     * specified item.
4009
     * <p>
4010
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/contains.png" alt="">
4011
     * <dl>
4012
     *  <dt><b>Scheduler:</b></dt>
4013
     *  <dd>{@code contains} does not operate by default on a particular {@link Scheduler}.</dd>
4014
     * </dl>
4015
     * 
4016
     * @param element
4017
     *            the item to search for in the emissions from the source Observable
4018
     * @return an Observable that emits {@code true} if the specified item is emitted by the source Observable,
4019
     *         or {@code false} if the source Observable completes without emitting that item
4020
     * @see <a href="http://reactivex.io/documentation/operators/contains.html">ReactiveX operators documentation: Contains</a>
4021
     */
4022
    public final Observable<Boolean> contains(final Object element) {
4023 1 1. contains : mutated return of Object value for rx/Observable::contains to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return exists(new Func1<T, Boolean>() {
4024
            @Override
4025
            public final Boolean call(T t1) {
4026 3 1. call : negated conditional → SURVIVED
2. call : negated conditional → KILLED
3. call : mutated return of Object value for rx/Observable$6::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return element == null ? t1 == null : element.equals(t1);
4027
            }
4028
        });
4029
    }
4030
4031
    /**
4032
     * Returns an Observable that emits the count of the total number of items emitted by the source Observable.
4033
     * <p>
4034
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/count.png" alt="">
4035
     * <dl>
4036
     *  <dt><b>Backpressure Support:</b></dt>
4037
     *  <dd>This operator does not support backpressure because by intent it will receive all values and reduce
4038
     *      them to a single {@code onNext}.</dd>
4039
     *  <dt><b>Scheduler:</b></dt>
4040
     *  <dd>{@code count} does not operate by default on a particular {@link Scheduler}.</dd>
4041
     * </dl>
4042
     * 
4043
     * @return an Observable that emits a single item: the number of elements emitted by the source Observable
4044
     * @see <a href="http://reactivex.io/documentation/operators/count.html">ReactiveX operators documentation: Count</a>
4045
     * @see #countLong()
4046
     */
4047
    public final Observable<Integer> count() {
4048 1 1. count : mutated return of Object value for rx/Observable::count to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return reduce(0, CountHolder.INSTANCE);
4049
    }
4050
    
4051
    private static final class CountHolder {
4052
        static final Func2<Integer, Object, Integer> INSTANCE = new Func2<Integer, Object, Integer>() {
4053
            @Override
4054
            public final Integer call(Integer count, Object o) {
4055 2 1. call : Replaced integer addition with subtraction → KILLED
2. call : mutated return of Object value for rx/Observable$CountHolder$1::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return count + 1;
4056
            }
4057
        };
4058
    }
4059
    
4060
    /**
4061
     * Returns an Observable that counts the total number of items emitted by the source Observable and emits
4062
     * this count as a 64-bit Long.
4063
     * <p>
4064
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/longCount.png" alt="">
4065
     * <dl>
4066
     *  <dt><b>Backpressure Support:</b></dt>
4067
     *  <dd>This operator does not support backpressure because by intent it will receive all values and reduce
4068
     *      them to a single {@code onNext}.</dd>
4069
     *  <dt><b>Scheduler:</b></dt>
4070
     *  <dd>{@code countLong} does not operate by default on a particular {@link Scheduler}.</dd>
4071
     * </dl>
4072
     * 
4073
     * @return an Observable that emits a single item: the number of items emitted by the source Observable as a
4074
     *         64-bit Long item
4075
     * @see <a href="http://reactivex.io/documentation/operators/count.html">ReactiveX operators documentation: Count</a>
4076
     * @see #count()
4077
     */
4078
    public final Observable<Long> countLong() {
4079 1 1. countLong : mutated return of Object value for rx/Observable::countLong to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return reduce(0L, CountLongHolder.INSTANCE);
4080
    }
4081
4082
    private static final class CountLongHolder {
4083
        static final Func2<Long, Object, Long> INSTANCE = new Func2<Long, Object, Long>() {
4084
            @Override
4085
            public final Long call(Long count, Object o) {
4086 2 1. call : Replaced long addition with subtraction → NO_COVERAGE
2. call : mutated return of Object value for rx/Observable$CountLongHolder$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return count + 1;
4087
            }
4088
        };
4089
    }
4090
    
4091
    /**
4092
     * Returns an Observable that mirrors the source Observable, except that it drops items emitted by the
4093
     * source Observable that are followed by another item within a computed debounce duration.
4094
     * <p>
4095
     * <img width="640" height="425" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/debounce.f.png" alt="">
4096
     * <dl>
4097
     *  <dt><b>Backpressure Support:</b></dt>
4098
     *  <dd>This operator does not support backpressure as it uses the {@code debounceSelector} to mark
4099
     *      boundaries.</dd>
4100
     *  <dt><b>Scheduler:</b></dt>
4101
     *  <dd>This version of {@code debounce} does not operate by default on a particular {@link Scheduler}.</dd>
4102
     * </dl>
4103
     * 
4104
     * @param <U>
4105
     *            the debounce value type (ignored)
4106
     * @param debounceSelector
4107
     *            function to retrieve a sequence that indicates the throttle duration for each item
4108
     * @return an Observable that omits items emitted by the source Observable that are followed by another item
4109
     *         within a computed debounce duration
4110
     * @see <a href="http://reactivex.io/documentation/operators/debounce.html">ReactiveX operators documentation: Debounce</a>
4111
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
4112
     */
4113
    public final <U> Observable<T> debounce(Func1<? super T, ? extends Observable<U>> debounceSelector) {
4114 1 1. debounce : mutated return of Object value for rx/Observable::debounce to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDebounceWithSelector<T, U>(debounceSelector));
4115
    }
4116
4117
    /**
4118
     * Returns an Observable that mirrors the source Observable, except that it drops items emitted by the
4119
     * source Observable that are followed by newer items before a timeout value expires. The timer resets on
4120
     * each emission.
4121
     * <p>
4122
     * <em>Note:</em> If items keep being emitted by the source Observable faster than the timeout then no items
4123
     * will be emitted by the resulting Observable.
4124
     * <p>
4125
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/debounce.png" alt="">
4126
     * <p>
4127
     * Information on debounce vs throttle:
4128
     * <p>
4129
     * <ul>
4130
     * <li><a href="http://drupalmotion.com/article/debounce-and-throttle-visual-explanation">Debounce and Throttle: visual explanation</a></li>
4131
     * <li><a href="http://unscriptable.com/2009/03/20/debouncing-javascript-methods/">Debouncing: javascript methods</a></li>
4132
     * <li><a href="http://www.illyriad.co.uk/blog/index.php/2011/09/javascript-dont-spam-your-server-debounce-and-throttle/">Javascript - don't spam your server: debounce and throttle</a></li>
4133
     * </ul>
4134
     * <dl>
4135
     *  <dt><b>Backpressure Support:</b></dt>
4136
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
4137
     *  <dt><b>Scheduler:</b></dt>
4138
     *  <dd>This version of {@code debounce} operates by default on the {@code computation} {@link Scheduler}.</dd>
4139
     * </dl>
4140
     * 
4141
     * @param timeout
4142
     *            the time each item has to be "the most recent" of those emitted by the source Observable to
4143
     *            ensure that it's not dropped
4144
     * @param unit
4145
     *            the {@link TimeUnit} for the timeout
4146
     * @return an Observable that filters out items from the source Observable that are too quickly followed by
4147
     *         newer items
4148
     * @see <a href="http://reactivex.io/documentation/operators/debounce.html">ReactiveX operators documentation: Debounce</a>
4149
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
4150
     * @see #throttleWithTimeout(long, TimeUnit)
4151
     */
4152
    public final Observable<T> debounce(long timeout, TimeUnit unit) {
4153 1 1. debounce : mutated return of Object value for rx/Observable::debounce to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return debounce(timeout, unit, Schedulers.computation());
4154
    }
4155
4156
    /**
4157
     * Returns an Observable that mirrors the source Observable, except that it drops items emitted by the
4158
     * source Observable that are followed by newer items before a timeout value expires on a specified
4159
     * Scheduler. The timer resets on each emission.
4160
     * <p>
4161
     * <em>Note:</em> If items keep being emitted by the source Observable faster than the timeout then no items
4162
     * will be emitted by the resulting Observable.
4163
     * <p>
4164
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/debounce.s.png" alt="">
4165
     * <p>
4166
     * Information on debounce vs throttle:
4167
     * <p>
4168
     * <ul>
4169
     * <li><a href="http://drupalmotion.com/article/debounce-and-throttle-visual-explanation">Debounce and Throttle: visual explanation</a></li>
4170
     * <li><a href="http://unscriptable.com/2009/03/20/debouncing-javascript-methods/">Debouncing: javascript methods</a></li>
4171
     * <li><a href="http://www.illyriad.co.uk/blog/index.php/2011/09/javascript-dont-spam-your-server-debounce-and-throttle/">Javascript - don't spam your server: debounce and throttle</a></li>
4172
     * </ul>
4173
     * <dl>
4174
     *  <dt><b>Backpressure Support:</b></dt>
4175
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
4176
     *  <dt><b>Scheduler:</b></dt>
4177
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
4178
     * </dl>
4179
     * 
4180
     * @param timeout
4181
     *            the time each item has to be "the most recent" of those emitted by the source Observable to
4182
     *            ensure that it's not dropped
4183
     * @param unit
4184
     *            the unit of time for the specified timeout
4185
     * @param scheduler
4186
     *            the {@link Scheduler} to use internally to manage the timers that handle the timeout for each
4187
     *            item
4188
     * @return an Observable that filters out items from the source Observable that are too quickly followed by
4189
     *         newer items
4190
     * @see <a href="http://reactivex.io/documentation/operators/debounce.html">ReactiveX operators documentation: Debounce</a>
4191
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
4192
     * @see #throttleWithTimeout(long, TimeUnit, Scheduler)
4193
     */
4194
    public final Observable<T> debounce(long timeout, TimeUnit unit, Scheduler scheduler) {
4195 1 1. debounce : mutated return of Object value for rx/Observable::debounce to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDebounceWithTime<T>(timeout, unit, scheduler));
4196
    }
4197
4198
    /**
4199
     * Returns an Observable that emits the items emitted by the source Observable or a specified default item
4200
     * if the source Observable is empty.
4201
     * <p>
4202
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/defaultIfEmpty.png" alt="">
4203
     * <dl>
4204
     *  <dt><b>Scheduler:</b></dt>
4205
     *  <dd>{@code defaultIfEmpty} does not operate by default on a particular {@link Scheduler}.</dd>
4206
     * </dl>
4207
     * 
4208
     * @param defaultValue
4209
     *            the item to emit if the source Observable emits no items
4210
     * @return an Observable that emits either the specified default item if the source Observable emits no
4211
     *         items, or the items emitted by the source Observable
4212
     * @see <a href="http://reactivex.io/documentation/operators/defaultifempty.html">ReactiveX operators documentation: DefaultIfEmpty</a>
4213
     */
4214
    public final Observable<T> defaultIfEmpty(final T defaultValue) {
4215
        //if empty switch to an observable that emits defaultValue and supports backpressure
4216 1 1. defaultIfEmpty : mutated return of Object value for rx/Observable::defaultIfEmpty to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return switchIfEmpty(Observable.create(new OnSubscribe<T>() {
4217
4218
            @Override
4219
            public void call(Subscriber<? super T> subscriber) {
4220 1 1. call : removed call to rx/Subscriber::setProducer → KILLED
                subscriber.setProducer(new SingleProducer<T>(subscriber, defaultValue));
4221
            }}));
4222
    }
4223
4224
    /**
4225
     * Returns an Observable that emits the items emitted by the source Observable or the items of an alternate
4226
     * Observable if the source Observable is empty.
4227
     * <p/>
4228
     * <dl>
4229
     *  <dt><b>Scheduler:</b></dt>
4230
     *  <dd>{@code switchIfEmpty} does not operate by default on a particular {@link Scheduler}.</dd>
4231
     * </dl>
4232
     *
4233
     * @param alternate
4234
     *              the alternate Observable to subscribe to if the source does not emit any items
4235
     * @return  an Observable that emits the items emitted by the source Observable or the items of an
4236
     *          alternate Observable if the source Observable is empty.
4237
     * @since 1.1.0
4238
     */
4239
    public final Observable<T> switchIfEmpty(Observable<? extends T> alternate) {
4240 1 1. switchIfEmpty : mutated return of Object value for rx/Observable::switchIfEmpty to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSwitchIfEmpty<T>(alternate));
4241
    }
4242
4243
    /**
4244
     * Returns an Observable that delays the subscription to and emissions from the souce Observable via another
4245
     * Observable on a per-item basis.
4246
     * <p>
4247
     * <img width="640" height="450" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.oo.png" alt="">
4248
     * <p>
4249
     * <em>Note:</em> the resulting Observable will immediately propagate any {@code onError} notification
4250
     * from the source Observable.
4251
     * <dl>
4252
     *  <dt><b>Scheduler:</b></dt>
4253
     *  <dd>This version of {@code delay} does not operate by default on a particular {@link Scheduler}.</dd>
4254
     * </dl>
4255
     * 
4256
     * @param <U>
4257
     *            the subscription delay value type (ignored)
4258
     * @param <V>
4259
     *            the item delay value type (ignored)
4260
     * @param subscriptionDelay
4261
     *            a function that returns an Observable that triggers the subscription to the source Observable
4262
     *            once it emits any item
4263
     * @param itemDelay
4264
     *            a function that returns an Observable for each item emitted by the source Observable, which is
4265
     *            then used to delay the emission of that item by the resulting Observable until the Observable
4266
     *            returned from {@code itemDelay} emits an item
4267
     * @return an Observable that delays the subscription and emissions of the source Observable via another
4268
     *         Observable on a per-item basis
4269
     * @see <a href="http://reactivex.io/documentation/operators/delay.html">ReactiveX operators documentation: Delay</a>
4270
     */
4271
    public final <U, V> Observable<T> delay(
4272
            Func0<? extends Observable<U>> subscriptionDelay,
4273
            Func1<? super T, ? extends Observable<V>> itemDelay) {
4274 1 1. delay : mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return delaySubscription(subscriptionDelay).lift(new OperatorDelayWithSelector<T, V>(this, itemDelay));
4275
    }
4276
4277
    /**
4278
     * Returns an Observable that delays the emissions of the source Observable via another Observable on a
4279
     * per-item basis.
4280
     * <p>
4281
     * <img width="640" height="450" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.o.png" alt="">
4282
     * <p>
4283
     * <em>Note:</em> the resulting Observable will immediately propagate any {@code onError} notification
4284
     * from the source Observable.
4285
     * <dl>
4286
     *  <dt><b>Scheduler:</b></dt>
4287
     *  <dd>This version of {@code delay} does not operate by default on a particular {@link Scheduler}.</dd>
4288
     * </dl>
4289
     * 
4290
     * @param <U>
4291
     *            the item delay value type (ignored)
4292
     * @param itemDelay
4293
     *            a function that returns an Observable for each item emitted by the source Observable, which is
4294
     *            then used to delay the emission of that item by the resulting Observable until the Observable
4295
     *            returned from {@code itemDelay} emits an item
4296
     * @return an Observable that delays the emissions of the source Observable via another Observable on a
4297
     *         per-item basis
4298
     * @see <a href="http://reactivex.io/documentation/operators/delay.html">ReactiveX operators documentation: Delay</a>
4299
     */
4300
    public final <U> Observable<T> delay(Func1<? super T, ? extends Observable<U>> itemDelay) {
4301 1 1. delay : mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDelayWithSelector<T, U>(this, itemDelay));
4302
    }
4303
4304
    /**
4305
     * Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a
4306
     * specified delay. Error notifications from the source Observable are not delayed.
4307
     * <p>
4308
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.png" alt="">
4309
     * <dl>
4310
     *  <dt><b>Scheduler:</b></dt>
4311
     *  <dd>This version of {@code delay} operates by default on the {@code compuation} {@link Scheduler}.</dd>
4312
     * </dl>
4313
     * 
4314
     * @param delay
4315
     *            the delay to shift the source by
4316
     * @param unit
4317
     *            the {@link TimeUnit} in which {@code period} is defined
4318
     * @return the source Observable shifted in time by the specified delay
4319
     * @see <a href="http://reactivex.io/documentation/operators/delay.html">ReactiveX operators documentation: Delay</a>
4320
     */
4321
    public final Observable<T> delay(long delay, TimeUnit unit) {
4322 1 1. delay : mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return delay(delay, unit, Schedulers.computation());
4323
    }
4324
4325
    /**
4326
     * Returns an Observable that emits the items emitted by the source Observable shifted forward in time by a
4327
     * specified delay. Error notifications from the source Observable are not delayed.
4328
     * <p>
4329
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delay.s.png" alt="">
4330
     * <dl>
4331
     *  <dt><b>Scheduler:</b></dt>
4332
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
4333
     * </dl>
4334
     * 
4335
     * @param delay
4336
     *            the delay to shift the source by
4337
     * @param unit
4338
     *            the time unit of {@code delay}
4339
     * @param scheduler
4340
     *            the {@link Scheduler} to use for delaying
4341
     * @return the source Observable shifted in time by the specified delay
4342
     * @see <a href="http://reactivex.io/documentation/operators/delay.html">ReactiveX operators documentation: Delay</a>
4343
     */
4344
    public final Observable<T> delay(long delay, TimeUnit unit, Scheduler scheduler) {
4345 1 1. delay : mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDelay<T>(delay, unit, scheduler));
4346
    }
4347
4348
    /**
4349
     * Returns an Observable that delays the subscription to the source Observable by a given amount of time.
4350
     * <p>
4351
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delaySubscription.png" alt="">
4352
     * <dl>
4353
     *  <dt><b>Scheduler:</b></dt>
4354
     *  <dd>This version of {@code delay} operates by default on the {@code compuation} {@link Scheduler}.</dd>
4355
     * </dl>
4356
     * 
4357
     * @param delay
4358
     *            the time to delay the subscription
4359
     * @param unit
4360
     *            the time unit of {@code delay}
4361
     * @return an Observable that delays the subscription to the source Observable by the given amount
4362
     * @see <a href="http://reactivex.io/documentation/operators/delay.html">ReactiveX operators documentation: Delay</a>
4363
     */
4364
    public final Observable<T> delaySubscription(long delay, TimeUnit unit) {
4365 1 1. delaySubscription : mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return delaySubscription(delay, unit, Schedulers.computation());
4366
    }
4367
4368
    /**
4369
     * Returns an Observable that delays the subscription to the source Observable by a given amount of time,
4370
     * both waiting and subscribing on a given Scheduler.
4371
     * <p>
4372
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delaySubscription.s.png" alt="">
4373
     * <dl>
4374
     *  <dt><b>Scheduler:</b></dt>
4375
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
4376
     * </dl>
4377
     * 
4378
     * @param delay
4379
     *            the time to delay the subscription
4380
     * @param unit
4381
     *            the time unit of {@code delay}
4382
     * @param scheduler
4383
     *            the Scheduler on which the waiting and subscription will happen
4384
     * @return an Observable that delays the subscription to the source Observable by a given
4385
     *         amount, waiting and subscribing on the given Scheduler
4386
     * @see <a href="http://reactivex.io/documentation/operators/delay.html">ReactiveX operators documentation: Delay</a>
4387
     */
4388
    public final Observable<T> delaySubscription(long delay, TimeUnit unit, Scheduler scheduler) {
4389 1 1. delaySubscription : mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeDelaySubscription<T>(this, delay, unit, scheduler));
4390
    }
4391
    
4392
    /**
4393
     * Returns an Observable that delays the subscription to the source Observable until a second Observable
4394
     * emits an item.
4395
     * <p>
4396
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/delaySubscription.o.png" alt="">
4397
     * <dl>
4398
     *  <dt><b>Scheduler:</b></dt>
4399
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4400
     * </dl>
4401
     * 
4402
     * @param subscriptionDelay
4403
     *            a function that returns an Observable that triggers the subscription to the source Observable
4404
     *            once it emits any item
4405
     * @return an Observable that delays the subscription to the source Observable until the Observable returned
4406
     *         by {@code subscriptionDelay} emits an item
4407
     * @see <a href="http://reactivex.io/documentation/operators/delay.html">ReactiveX operators documentation: Delay</a>
4408
     */
4409
    public final <U> Observable<T> delaySubscription(Func0<? extends Observable<U>> subscriptionDelay) {
4410 1 1. delaySubscription : mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeDelaySubscriptionWithSelector<T, U>(this, subscriptionDelay));
4411
    }
4412
4413
    /**
4414
     * Returns an Observable that delays the subscription to this Observable
4415
     * until the other Observable emits an element or completes normally.
4416
     * <p>
4417
     * <dl>
4418
     *  <dt><b>Backpressure:</b></dt>
4419
     *  <dd>The operator forwards the backpressure requests to this Observable once
4420
     *  the subscription happens and requests Long.MAX_VALUE from the other Observable</dd>
4421
     *  <dt><b>Scheduler:</b></dt>
4422
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4423
     * </dl>
4424
     * 
4425
     * @param <U> the value type of the other Observable, irrelevant
4426
     * @param other the other Observable that should trigger the subscription
4427
     *        to this Observable.
4428
     * @return an Observable that delays the subscription to this Observable
4429
     *         until the other Observable emits an element or completes normally.
4430
     */
4431
    @Experimental
4432
    public final <U> Observable<T> delaySubscription(Observable<U> other) {
4433 1 1. delaySubscription : negated conditional → KILLED
        if (other == null) {
4434
            throw new NullPointerException();
4435
        }
4436 1 1. delaySubscription : mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeDelaySubscriptionOther<T, U>(this, other));
4437
    }
4438
    
4439
    /**
4440
     * Returns an Observable that reverses the effect of {@link #materialize materialize} by transforming the
4441
     * {@link Notification} objects emitted by the source Observable into the items or notifications they
4442
     * represent.
4443
     * <p>
4444
     * <img width="640" height="335" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/dematerialize.png" alt="">
4445
     * <dl>
4446
     *  <dt><b>Scheduler:</b></dt>
4447
     *  <dd>{@code dematerialize} does not operate by default on a particular {@link Scheduler}.</dd>
4448
     * </dl>
4449
     * 
4450
     * @return an Observable that emits the items and notifications embedded in the {@link Notification} objects
4451
     *         emitted by the source Observable
4452
     * @throws OnErrorNotImplementedException
4453
     *             if the source Observable is not of type {@code Observable<Notification<T>>}
4454
     * @see <a href="http://reactivex.io/documentation/operators/materialize-dematerialize.html">ReactiveX operators documentation: Dematerialize</a>
4455
     */
4456
    @SuppressWarnings({"unchecked"})
4457
    public final <T2> Observable<T2> dematerialize() {
4458 1 1. dematerialize : mutated return of Object value for rx/Observable::dematerialize to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorDematerialize.instance());
4459
    }
4460
4461
    /**
4462
     * Returns an Observable that emits all items emitted by the source Observable that are distinct.
4463
     * <p>
4464
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinct.png" alt="">
4465
     * <dl>
4466
     *  <dt><b>Scheduler:</b></dt>
4467
     *  <dd>{@code distinct} does not operate by default on a particular {@link Scheduler}.</dd>
4468
     * </dl>
4469
     * 
4470
     * @return an Observable that emits only those items emitted by the source Observable that are distinct from
4471
     *         each other
4472
     * @see <a href="http://reactivex.io/documentation/operators/distinct.html">ReactiveX operators documentation: Distinct</a>
4473
     */
4474
    public final Observable<T> distinct() {
4475 1 1. distinct : mutated return of Object value for rx/Observable::distinct to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorDistinct.<T> instance());
4476
    }
4477
4478
    /**
4479
     * Returns an Observable that emits all items emitted by the source Observable that are distinct according
4480
     * to a key selector function.
4481
     * <p>
4482
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinct.key.png" alt="">
4483
     * <dl>
4484
     *  <dt><b>Scheduler:</b></dt>
4485
     *  <dd>{@code distinct} does not operate by default on a particular {@link Scheduler}.</dd>
4486
     * </dl>
4487
     * 
4488
     * @param keySelector
4489
     *            a function that projects an emitted item to a key value that is used to decide whether an item
4490
     *            is distinct from another one or not
4491
     * @return an Observable that emits those items emitted by the source Observable that have distinct keys
4492
     * @see <a href="http://reactivex.io/documentation/operators/distinct.html">ReactiveX operators documentation: Distinct</a>
4493
     */
4494
    public final <U> Observable<T> distinct(Func1<? super T, ? extends U> keySelector) {
4495 1 1. distinct : mutated return of Object value for rx/Observable::distinct to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDistinct<T, U>(keySelector));
4496
    }
4497
4498
    /**
4499
     * Returns an Observable that emits all items emitted by the source Observable that are distinct from their
4500
     * immediate predecessors.
4501
     * <p>
4502
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinctUntilChanged.png" alt="">
4503
     * <dl>
4504
     *  <dt><b>Scheduler:</b></dt>
4505
     *  <dd>{@code distinctUntilChanged} does not operate by default on a particular {@link Scheduler}.</dd>
4506
     * </dl>
4507
     * 
4508
     * @return an Observable that emits those items from the source Observable that are distinct from their
4509
     *         immediate predecessors
4510
     * @see <a href="http://reactivex.io/documentation/operators/distinct.html">ReactiveX operators documentation: Distinct</a>
4511
     */
4512
    public final Observable<T> distinctUntilChanged() {
4513 1 1. distinctUntilChanged : mutated return of Object value for rx/Observable::distinctUntilChanged to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorDistinctUntilChanged.<T> instance());
4514
    }
4515
4516
    /**
4517
     * Returns an Observable that emits all items emitted by the source Observable that are distinct from their
4518
     * immediate predecessors, according to a key selector function.
4519
     * <p>
4520
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/distinctUntilChanged.key.png" alt="">
4521
     * <dl>
4522
     *  <dt><b>Scheduler:</b></dt>
4523
     *  <dd>{@code distinctUntilChanged} does not operate by default on a particular {@link Scheduler}.</dd>
4524
     * </dl>
4525
     * 
4526
     * @param keySelector
4527
     *            a function that projects an emitted item to a key value that is used to decide whether an item
4528
     *            is distinct from another one or not
4529
     * @return an Observable that emits those items from the source Observable whose keys are distinct from
4530
     *         those of their immediate predecessors
4531
     * @see <a href="http://reactivex.io/documentation/operators/distinct.html">ReactiveX operators documentation: Distinct</a>
4532
     */
4533
    public final <U> Observable<T> distinctUntilChanged(Func1<? super T, ? extends U> keySelector) {
4534 1 1. distinctUntilChanged : mutated return of Object value for rx/Observable::distinctUntilChanged to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDistinctUntilChanged<T, U>(keySelector));
4535
    }
4536
4537
    /**
4538
     * Modifies the source Observable so that it invokes an action when it calls {@code onCompleted}.
4539
     * <p>
4540
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnCompleted.png" alt="">
4541
     * <dl>
4542
     *  <dt><b>Scheduler:</b></dt>
4543
     *  <dd>{@code doOnCompleted} does not operate by default on a particular {@link Scheduler}.</dd>
4544
     * </dl>
4545
     * 
4546
     * @param onCompleted
4547
     *            the action to invoke when the source Observable calls {@code onCompleted}
4548
     * @return the source Observable with the side-effecting behavior applied
4549
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4550
     */
4551
    public final Observable<T> doOnCompleted(final Action0 onCompleted) {
4552
        Observer<T> observer = new Observer<T>() {
4553
            @Override
4554
            public final void onCompleted() {
4555 1 1. onCompleted : removed call to rx/functions/Action0::call → KILLED
                onCompleted.call();
4556
            }
4557
4558
            @Override
4559
            public final void onError(Throwable e) {
4560
            }
4561
4562
            @Override
4563
            public final void onNext(T args) {
4564
            }
4565
4566
        };
4567
4568 1 1. doOnCompleted : mutated return of Object value for rx/Observable::doOnCompleted to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnEach<T>(observer));
4569
    }
4570
4571
    /**
4572
     * Modifies the source Observable so that it invokes an action for each item it emits.
4573
     * <p>
4574
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnEach.png" alt="">
4575
     * <dl>
4576
     *  <dt><b>Scheduler:</b></dt>
4577
     *  <dd>{@code doOnEach} does not operate by default on a particular {@link Scheduler}.</dd>
4578
     * </dl>
4579
     * 
4580
     * @param onNotification
4581
     *            the action to invoke for each item emitted by the source Observable
4582
     * @return the source Observable with the side-effecting behavior applied
4583
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4584
     */
4585
    public final Observable<T> doOnEach(final Action1<Notification<? super T>> onNotification) {
4586
        Observer<T> observer = new Observer<T>() {
4587
            @Override
4588
            public final void onCompleted() {
4589 1 1. onCompleted : removed call to rx/functions/Action1::call → SURVIVED
                onNotification.call(Notification.createOnCompleted());
4590
            }
4591
4592
            @Override
4593
            public final void onError(Throwable e) {
4594 1 1. onError : removed call to rx/functions/Action1::call → SURVIVED
                onNotification.call(Notification.createOnError(e));
4595
            }
4596
4597
            @Override
4598
            public final void onNext(T v) {
4599 1 1. onNext : removed call to rx/functions/Action1::call → KILLED
                onNotification.call(Notification.createOnNext(v));
4600
            }
4601
4602
        };
4603
4604 1 1. doOnEach : mutated return of Object value for rx/Observable::doOnEach to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnEach<T>(observer));
4605
    }
4606
4607
    /**
4608
     * Modifies the source Observable so that it notifies an Observer for each item it emits.
4609
     * <p>
4610
     * In case the {@code onError} of the supplied observer throws, the downstream will receive a composite
4611
     * exception containing the original exception and the exception thrown by {@code onError}. If either the
4612
     * {@code onNext} or the {@code onCompleted} method of the supplied observer throws, the downstream will be
4613
     * terminated and will receive this thrown exception.
4614
     * <p>
4615
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnEach.png" alt="">
4616
     * <dl>
4617
     *  <dt><b>Scheduler:</b></dt>
4618
     *  <dd>{@code doOnEach} does not operate by default on a particular {@link Scheduler}.</dd>
4619
     * </dl>
4620
     * 
4621
     * @param observer
4622
     *            the action to invoke for each item emitted by the source Observable
4623
     * @return the source Observable with the side-effecting behavior applied
4624
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4625
     */
4626
    public final Observable<T> doOnEach(Observer<? super T> observer) {
4627 1 1. doOnEach : mutated return of Object value for rx/Observable::doOnEach to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnEach<T>(observer));
4628
    }
4629
4630
    /**
4631
     * Modifies the source Observable so that it invokes an action if it calls {@code onError}.
4632
     * <p>
4633
     * In case the {@code onError} action throws, the downstream will receive a composite exception containing
4634
     * the original exception and the exception thrown by {@code onError}.
4635
     * <p>
4636
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnError.png" alt="">
4637
     * <dl>
4638
     *  <dt><b>Scheduler:</b></dt>
4639
     *  <dd>{@code doOnError} does not operate by default on a particular {@link Scheduler}.</dd>
4640
     * </dl>
4641
     * 
4642
     * @param onError
4643
     *            the action to invoke if the source Observable calls {@code onError}
4644
     * @return the source Observable with the side-effecting behavior applied
4645
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4646
     */
4647
    public final Observable<T> doOnError(final Action1<Throwable> onError) {
4648
        Observer<T> observer = new Observer<T>() {
4649
            @Override
4650
            public final void onCompleted() {
4651
            }
4652
4653
            @Override
4654
            public final void onError(Throwable e) {
4655 1 1. onError : removed call to rx/functions/Action1::call → KILLED
                onError.call(e);
4656
            }
4657
4658
            @Override
4659
            public final void onNext(T args) {
4660
            }
4661
4662
        };
4663
4664 1 1. doOnError : mutated return of Object value for rx/Observable::doOnError to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnEach<T>(observer));
4665
    }
4666
4667
    /**
4668
     * Modifies the source Observable so that it invokes an action when it calls {@code onNext}.
4669
     * <p>
4670
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnNext.png" alt="">
4671
     * <dl>
4672
     *  <dt><b>Scheduler:</b></dt>
4673
     *  <dd>{@code doOnNext} does not operate by default on a particular {@link Scheduler}.</dd>
4674
     * </dl>
4675
     * 
4676
     * @param onNext
4677
     *            the action to invoke when the source Observable calls {@code onNext}
4678
     * @return the source Observable with the side-effecting behavior applied
4679
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4680
     */
4681
    public final Observable<T> doOnNext(final Action1<? super T> onNext) {
4682
        Observer<T> observer = new Observer<T>() {
4683
            @Override
4684
            public final void onCompleted() {
4685
            }
4686
4687
            @Override
4688
            public final void onError(Throwable e) {
4689
            }
4690
4691
            @Override
4692
            public final void onNext(T args) {
4693 1 1. onNext : removed call to rx/functions/Action1::call → KILLED
                onNext.call(args);
4694
            }
4695
4696
        };
4697
4698 1 1. doOnNext : mutated return of Object value for rx/Observable::doOnNext to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnEach<T>(observer));
4699
    }
4700
4701
    /**
4702
     * Modifies the source {@code Observable} so that it invokes the given action when it receives a
4703
     * request for more items.
4704
     * <p>
4705
     * <b>Note:</b> This operator is for tracing the internal behavior of back-pressure request
4706
     * patterns and generally intended for debugging use.
4707
     * <dl>
4708
     * <dt><b>Scheduler:</b></dt>
4709
     * <dd>{@code doOnRequest} does not operate by default on a particular {@link Scheduler}.</dd>
4710
     * </dl>
4711
     *
4712
     * @param onRequest
4713
     *            the action that gets called when an observer requests items from this
4714
     *            {@code Observable}
4715
     * @return the source {@code Observable} modified so as to call this Action when appropriate
4716
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators
4717
     *      documentation: Do</a>
4718
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical
4719
     *        with the release number)
4720
     */
4721
    @Beta
4722
    public final Observable<T> doOnRequest(final Action1<Long> onRequest) {
4723 1 1. doOnRequest : mutated return of Object value for rx/Observable::doOnRequest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnRequest<T>(onRequest));
4724
    }
4725
4726
    /**
4727
     * Modifies the source {@code Observable} so that it invokes the given action when it is subscribed from
4728
     * its subscribers. Each subscription will result in an invocation of the given action except when the
4729
     * source {@code Observable} is reference counted, in which case the source {@code Observable} will invoke
4730
     * the given action for the first subscription.
4731
     * <p>
4732
     * <img width="640" height="390" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnSubscribe.png" alt="">
4733
     * <dl>
4734
     *  <dt><b>Scheduler:</b></dt>
4735
     *  <dd>{@code doOnSubscribe} does not operate by default on a particular {@link Scheduler}.</dd>
4736
     * </dl>
4737
     *
4738
     * @param subscribe
4739
     *            the action that gets called when an observer subscribes to this {@code Observable}
4740
     * @return the source {@code Observable} modified so as to call this Action when appropriate
4741
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4742
     */
4743
    public final Observable<T> doOnSubscribe(final Action0 subscribe) {
4744 1 1. doOnSubscribe : mutated return of Object value for rx/Observable::doOnSubscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnSubscribe<T>(subscribe));
4745
    }
4746
    
4747
    /**
4748
     * Modifies the source Observable so that it invokes an action when it calls {@code onCompleted} or
4749
     * {@code onError}.
4750
     * <p>
4751
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnTerminate.png" alt="">
4752
     * <p>
4753
     * This differs from {@code finallyDo} in that this happens <em>before</em> the {@code onCompleted} or
4754
     * {@code onError} notification.
4755
     * <dl>
4756
     *  <dt><b>Scheduler:</b></dt>
4757
     *  <dd>{@code doOnTerminate} does not operate by default on a particular {@link Scheduler}.</dd>
4758
     * </dl>
4759
     * 
4760
     * @param onTerminate
4761
     *            the action to invoke when the source Observable calls {@code onCompleted} or {@code onError}
4762
     * @return the source Observable with the side-effecting behavior applied
4763
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4764
     * @see #finallyDo(Action0)
4765
     */
4766
    public final Observable<T> doOnTerminate(final Action0 onTerminate) {
4767
        Observer<T> observer = new Observer<T>() {
4768
            @Override
4769
            public final void onCompleted() {
4770 1 1. onCompleted : removed call to rx/functions/Action0::call → KILLED
                onTerminate.call();
4771
            }
4772
4773
            @Override
4774
            public final void onError(Throwable e) {
4775 1 1. onError : removed call to rx/functions/Action0::call → KILLED
                onTerminate.call();
4776
            }
4777
4778
            @Override
4779
            public final void onNext(T args) {
4780
            }
4781
4782
        };
4783
4784 1 1. doOnTerminate : mutated return of Object value for rx/Observable::doOnTerminate to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnEach<T>(observer));
4785
    }
4786
    
4787
    /**
4788
     * Modifies the source {@code Observable} so that it invokes the given action when it is unsubscribed from
4789
     * its subscribers. Each un-subscription will result in an invocation of the given action except when the
4790
     * source {@code Observable} is reference counted, in which case the source {@code Observable} will invoke
4791
     * the given action for the very last un-subscription.
4792
     * <p>
4793
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/doOnUnsubscribe.png" alt="">
4794
     * <dl>
4795
     *  <dt><b>Scheduler:</b></dt>
4796
     *  <dd>{@code doOnUnsubscribe} does not operate by default on a particular {@link Scheduler}.</dd>
4797
     * </dl>
4798
     *
4799
     * @param unsubscribe
4800
     *            the action that gets called when this {@code Observable} is unsubscribed
4801
     * @return the source {@code Observable} modified so as to call this Action when appropriate
4802
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
4803
     */
4804
    public final Observable<T> doOnUnsubscribe(final Action0 unsubscribe) {
4805 1 1. doOnUnsubscribe : mutated return of Object value for rx/Observable::doOnUnsubscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoOnUnsubscribe<T>(unsubscribe));
4806
    }
4807
4808
    /**
4809
     * Concatenates two source Observables eagerly into a single stream of values.
4810
     * <p>
4811
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
4812
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
4813
     * in order, each one after the previous one completes.
4814
     * <dl>
4815
     *  <dt><b>Backpressure:</b></dt>
4816
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
4817
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
4818
     *  <dt><b>Scheduler:</b></dt>
4819
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4820
     * </dl>
4821
     * @param <T> the value type 
4822
     * @param o1 the first source
4823
     * @param o2 the second source
4824
     * @return
4825
     * @warn javadoc fails to describe the return value
4826
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
4827
     */
4828
    @Experimental
4829
    @SuppressWarnings("unchecked")
4830
    public static <T> Observable<T> concatEager(Observable<? extends T> o1, Observable<? extends T> o2) {
4831 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2));
4832
    }
4833
    
4834
    /**
4835
     * Concatenates three sources eagerly into a single stream of values.
4836
     * <p>
4837
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
4838
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
4839
     * in order, each one after the previous one completes.
4840
     * <dl>
4841
     *  <dt><b>Backpressure:</b></dt>
4842
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
4843
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
4844
     *  <dt><b>Scheduler:</b></dt>
4845
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4846
     * </dl>
4847
     * @param <T> the value type
4848
     * @param o1 the first source
4849
     * @param o2 the second source
4850
     * @param o3 the third source
4851
     * @return
4852
     * @warn javadoc fails to describe the return value
4853
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
4854
     */
4855
    @Experimental
4856
    @SuppressWarnings("unchecked")
4857
    public static <T> Observable<T> concatEager(
4858
            Observable<? extends T> o1, Observable<? extends T> o2,
4859
            Observable<? extends T> o3
4860
        ) {
4861 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2, o3));
4862
    }
4863
    
4864
    /**
4865
     * Concatenates four sources eagerly into a single stream of values.
4866
     * <p>
4867
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
4868
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
4869
     * in order, each one after the previous one completes.
4870
     * <dl>
4871
     *  <dt><b>Backpressure:</b></dt>
4872
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
4873
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
4874
     *  <dt><b>Scheduler:</b></dt>
4875
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4876
     * </dl>
4877
     * @param <T> the value type
4878
     * @param o1 the first source
4879
     * @param o2 the second source
4880
     * @param o3 the third source
4881
     * @param o4 the fourth source
4882
     * @return
4883
     * @warn javadoc fails to describe the return value
4884
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
4885
     */
4886
    @Experimental
4887
    @SuppressWarnings("unchecked")
4888
    public static <T> Observable<T> concatEager(
4889
            Observable<? extends T> o1, Observable<? extends T> o2,
4890
            Observable<? extends T> o3, Observable<? extends T> o4
4891
        ) {
4892 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2, o3, o4));
4893
    }
4894
    
4895
    /**
4896
     * Concatenates five sources eagerly into a single stream of values.
4897
     * <p>
4898
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
4899
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
4900
     * in order, each one after the previous one completes.
4901
     * <dl>
4902
     *  <dt><b>Backpressure:</b></dt>
4903
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
4904
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
4905
     *  <dt><b>Scheduler:</b></dt>
4906
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4907
     * </dl>
4908
     * @param <T> the value type
4909
     * @param o1 the first source
4910
     * @param o2 the second source
4911
     * @param o3 the third source
4912
     * @param o4 the fourth source
4913
     * @param o5 the fifth source
4914
     * @return
4915
     * @warn javadoc fails to describe the return value
4916
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
4917
     */
4918
    @Experimental
4919
    @SuppressWarnings("unchecked")
4920
    public static <T> Observable<T> concatEager(
4921
            Observable<? extends T> o1, Observable<? extends T> o2,
4922
            Observable<? extends T> o3, Observable<? extends T> o4,
4923
            Observable<? extends T> o5
4924
        ) {
4925 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2, o3, o4, o5));
4926
    }
4927
4928
    /**
4929
     * Concatenates six sources eagerly into a single stream of values.
4930
     * <p>
4931
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
4932
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
4933
     * in order, each one after the previous one completes.
4934
     * <dl>
4935
     *  <dt><b>Backpressure:</b></dt>
4936
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
4937
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
4938
     *  <dt><b>Scheduler:</b></dt>
4939
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4940
     * </dl>
4941
     * @param <T> the value type
4942
     * @param o1 the first source
4943
     * @param o2 the second source
4944
     * @param o3 the third source
4945
     * @param o4 the fourth source
4946
     * @param o5 the fifth source
4947
     * @param o6 the sixth source
4948
     * @return
4949
     * @warn javadoc fails to describe the return value
4950
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
4951
     */
4952
    @Experimental
4953
    @SuppressWarnings("unchecked")
4954
    public static <T> Observable<T> concatEager(
4955
            Observable<? extends T> o1, Observable<? extends T> o2,
4956
            Observable<? extends T> o3, Observable<? extends T> o4,
4957
            Observable<? extends T> o5, Observable<? extends T> o6
4958
        ) {
4959 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2, o3, o4, o5, o6));
4960
    }
4961
4962
    /**
4963
     * Concatenates seven sources eagerly into a single stream of values.
4964
     * <p>
4965
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
4966
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
4967
     * in order, each one after the previous one completes.
4968
     * <dl>
4969
     *  <dt><b>Backpressure:</b></dt>
4970
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
4971
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
4972
     *  <dt><b>Scheduler:</b></dt>
4973
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
4974
     * </dl>
4975
     * @param <T> the value type
4976
     * @param o1 the first source
4977
     * @param o2 the second source
4978
     * @param o3 the third source
4979
     * @param o4 the fourth source
4980
     * @param o5 the fifth source
4981
     * @param o6 the sixth source
4982
     * @param o7 the seventh source
4983
     * @return
4984
     * @warn javadoc fails to describe the return value
4985
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
4986
     */
4987
    @Experimental
4988
    @SuppressWarnings("unchecked")
4989
    public static <T> Observable<T> concatEager(
4990
            Observable<? extends T> o1, Observable<? extends T> o2,
4991
            Observable<? extends T> o3, Observable<? extends T> o4,
4992
            Observable<? extends T> o5, Observable<? extends T> o6,
4993
            Observable<? extends T> o7
4994
        ) {
4995 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2, o3, o4, o5, o6, o7));
4996
    }
4997
    
4998
    /**
4999
     * Concatenates eight sources eagerly into a single stream of values.
5000
     * <p>
5001
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5002
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
5003
     * in order, each one after the previous one completes.
5004
     * <dl>
5005
     *  <dt><b>Backpressure:</b></dt>
5006
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5007
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5008
     *  <dt><b>Scheduler:</b></dt>
5009
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5010
     * </dl>
5011
     * @param <T> the value type
5012
     * @param o1 the first source
5013
     * @param o2 the second source
5014
     * @param o3 the third source
5015
     * @param o4 the fourth source
5016
     * @param o5 the fifth source
5017
     * @param o6 the sixth source
5018
     * @param o7 the seventh source
5019
     * @param o8 the eighth source
5020
     * @return
5021
     * @warn javadoc fails to describe the return value
5022
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5023
     */
5024
    @Experimental
5025
    @SuppressWarnings("unchecked")
5026
    public static <T> Observable<T> concatEager(
5027
            Observable<? extends T> o1, Observable<? extends T> o2,
5028
            Observable<? extends T> o3, Observable<? extends T> o4,
5029
            Observable<? extends T> o5, Observable<? extends T> o6,
5030
            Observable<? extends T> o7, Observable<? extends T> o8
5031
        ) {
5032 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2, o3, o4, o5, o6, o7, o8));
5033
    }
5034
5035
    /**
5036
     * Concatenates nine sources eagerly into a single stream of values.
5037
     * <p>
5038
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5039
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
5040
     * in order, each one after the previous one completes.
5041
     * <dl>
5042
     *  <dt><b>Backpressure:</b></dt>
5043
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5044
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5045
     *  <dt><b>Scheduler:</b></dt>
5046
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5047
     * </dl>
5048
     * @param <T> the value type
5049
     * @param o1 the first source
5050
     * @param o2 the second source
5051
     * @param o3 the third source
5052
     * @param o4 the fourth source
5053
     * @param o5 the fifth source
5054
     * @param o6 the sixth source
5055
     * @param o7 the seventh source
5056
     * @param o8 the eighth source
5057
     * @param o9 the ninth source
5058
     * @return
5059
     * @warn javadoc fails to describe the return value
5060
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5061
     */
5062
    @Experimental
5063
    @SuppressWarnings("unchecked")
5064
    public static <T> Observable<T> concatEager(
5065
            Observable<? extends T> o1, Observable<? extends T> o2,
5066
            Observable<? extends T> o3, Observable<? extends T> o4,
5067
            Observable<? extends T> o5, Observable<? extends T> o6,
5068
            Observable<? extends T> o7, Observable<? extends T> o8,
5069
            Observable<? extends T> o9
5070
        ) {
5071 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatEager(Arrays.asList(o1, o2, o3, o4, o5, o6, o7, o8, o9));
5072
    }
5073
5074
    /**
5075
     * Concatenates a sequence of Observables eagerly into a single stream of values.
5076
     * <p>
5077
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5078
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
5079
     * in order, each one after the previous one completes.
5080
     * <dl>
5081
     *  <dt><b>Backpressure:</b></dt>
5082
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5083
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5084
     *  <dt><b>Scheduler:</b></dt>
5085
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5086
     * </dl>
5087
     * @param <T> the value type
5088
     * @param sources a sequence of Observables that need to be eagerly concatenated
5089
     * @return
5090
     * @warn javadoc fails to describe the return value
5091
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5092
     */
5093
    @Experimental
5094
    @SuppressWarnings({ "unchecked", "rawtypes" })
5095
    public static <T> Observable<T> concatEager(Iterable<? extends Observable<? extends T>> sources) {
5096 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return Observable.from(sources).concatMapEager((Func1)UtilityFunctions.identity());
5097
    }
5098
5099
    /**
5100
     * Concatenates a sequence of Observables eagerly into a single stream of values.
5101
     * <p>
5102
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5103
     * source Observables. The operator buffers the values emitted by these Observables and then drains them
5104
     * in order, each one after the previous one completes.
5105
     * <dl>
5106
     *  <dt><b>Backpressure:</b></dt>
5107
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5108
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5109
     *  <dt><b>Scheduler:</b></dt>
5110
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5111
     * </dl>
5112
     * @param <T> the value type
5113
     * @param sources a sequence of Observables that need to be eagerly concatenated
5114
     * @param capacityHint hints about the number of expected source sequence values
5115
     * @return
5116
     * @warn javadoc fails to describe the return value
5117
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5118
     */
5119
    @Experimental
5120
    @SuppressWarnings({ "unchecked", "rawtypes" })
5121
    public static <T> Observable<T> concatEager(Iterable<? extends Observable<? extends T>> sources, int capacityHint) {
5122 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return Observable.from(sources).concatMapEager((Func1)UtilityFunctions.identity(), capacityHint);
5123
    }
5124
    
5125
    /**
5126
     * Concatenates an Observable sequence of Observables eagerly into a single stream of values.
5127
     * <p>
5128
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5129
     * emitted source Observables as they are observed. The operator buffers the values emitted by these
5130
     * Observables and then drains them in order, each one after the previous one completes.
5131
     * <dl>
5132
     *  <dt><b>Backpressure:</b></dt>
5133
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5134
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5135
     *  <dt><b>Scheduler:</b></dt>
5136
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5137
     * </dl>
5138
     * @param <T> the value type
5139
     * @param sources a sequence of Observables that need to be eagerly concatenated
5140
     * @return
5141
     * @warn javadoc fails to describe the return value
5142
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5143
     */
5144
    @Experimental
5145
    @SuppressWarnings({ "unchecked", "rawtypes" })
5146
    public static <T> Observable<T> concatEager(Observable<? extends Observable<? extends T>> sources) {
5147 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return sources.concatMapEager((Func1)UtilityFunctions.identity());
5148
    }
5149
5150
    /**
5151
     * Concatenates an Observable sequence of Observables eagerly into a single stream of values.
5152
     * <p>
5153
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5154
     * emitted source Observables as they are observed. The operator buffers the values emitted by these
5155
     * Observables and then drains them in order, each one after the previous one completes.
5156
     * <dl>
5157
     *  <dt><b>Backpressure:</b></dt>
5158
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5159
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5160
     *  <dt><b>Scheduler:</b></dt>
5161
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5162
     * </dl>
5163
     * @param <T> the value type
5164
     * @param sources a sequence of Observables that need to be eagerly concatenated
5165
     * @param capacityHint hints about the number of expected source sequence values
5166
     * @return
5167
     * @warn javadoc fails to describe the return value
5168
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5169
     */
5170
    @Experimental
5171
    @SuppressWarnings({ "unchecked", "rawtypes" })
5172
    public static <T> Observable<T> concatEager(Observable<? extends Observable<? extends T>> sources, int capacityHint) {
5173 1 1. concatEager : mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return sources.concatMapEager((Func1)UtilityFunctions.identity(), capacityHint);
5174
    }
5175
    
5176
    /**
5177
     * Maps a sequence of values into Observables and concatenates these Observables eagerly into a single
5178
     * Observable.
5179
     * <p>
5180
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5181
     * source Observables. The operator buffers the values emitted by these Observables and then drains them in
5182
     * order, each one after the previous one completes.
5183
     * <dl>
5184
     *  <dt><b>Backpressure:</b></dt>
5185
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5186
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5187
     *  <dt><b>Scheduler:</b></dt>
5188
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5189
     * </dl>
5190
     * @param <R> the value type
5191
     * @param mapper the function that maps a sequence of values into a sequence of Observables that will be
5192
     *               eagerly concatenated
5193
     * @return
5194
     * @warn javadoc fails to describe the return value
5195
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5196
     */
5197
    @Experimental
5198
    public final <R> Observable<R> concatMapEager(Func1<? super T, ? extends Observable<? extends R>> mapper) {
5199 1 1. concatMapEager : mutated return of Object value for rx/Observable::concatMapEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concatMapEager(mapper, RxRingBuffer.SIZE);
5200
    }
5201
5202
    /**
5203
     * Maps a sequence of values into Observables and concatenates these Observables eagerly into a single
5204
     * Observable.
5205
     * <p>
5206
     * Eager concatenation means that once a subscriber subscribes, this operator subscribes to all of the
5207
     * source Observables. The operator buffers the values emitted by these Observables and then drains them in
5208
     * order, each one after the previous one completes.
5209
     * <dl>
5210
     *  <dt><b>Backpressure:</b></dt>
5211
     *  <dd>Backpressure is honored towards the downstream, however, due to the eagerness requirement, sources
5212
     *      are subscribed to in unbounded mode and their values are queued up in an unbounded buffer.</dd>
5213
     *  <dt><b>Scheduler:</b></dt>
5214
     *  <dd>This method does not operate by default on a particular {@link Scheduler}.</dd>
5215
     * </dl>
5216
     * @param <R> the value type
5217
     * @param mapper the function that maps a sequence of values into a sequence of Observables that will be
5218
     *               eagerly concatenated
5219
     * @param capacityHint hints about the number of expected source sequence values
5220
     * @return 
5221
     * @warn javadoc fails to describe the return value
5222
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5223
     */
5224
    @Experimental
5225
    public final <R> Observable<R> concatMapEager(Func1<? super T, ? extends Observable<? extends R>> mapper, int capacityHint) {
5226 2 1. concatMapEager : changed conditional boundary → SURVIVED
2. concatMapEager : negated conditional → KILLED
        if (capacityHint < 1) {
5227
            throw new IllegalArgumentException("capacityHint > 0 required but it was " + capacityHint);
5228
        }
5229 1 1. concatMapEager : mutated return of Object value for rx/Observable::concatMapEager to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorEagerConcatMap<T, R>(mapper, capacityHint));
5230
    }
5231
    
5232
    /**
5233
     * Returns an Observable that emits the single item at a specified index in a sequence of emissions from a
5234
     * source Observbable.
5235
     * <p>
5236
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/elementAt.png" alt="">
5237
     * <dl>
5238
     *  <dt><b>Scheduler:</b></dt>
5239
     *  <dd>{@code elementAt} does not operate by default on a particular {@link Scheduler}.</dd>
5240
     * </dl>
5241
     * 
5242
     * @param index
5243
     *            the zero-based index of the item to retrieve
5244
     * @return an Observable that emits a single item: the item at the specified position in the sequence of
5245
     *         those emitted by the source Observable
5246
     * @throws IndexOutOfBoundsException
5247
     *             if {@code index} is greater than or equal to the number of items emitted by the source
5248
     *             Observable, or
5249
     *             if {@code index} is less than 0
5250
     * @see <a href="http://reactivex.io/documentation/operators/elementat.html">ReactiveX operators documentation: ElementAt</a>
5251
     */
5252
    public final Observable<T> elementAt(int index) {
5253 1 1. elementAt : mutated return of Object value for rx/Observable::elementAt to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorElementAt<T>(index));
5254
    }
5255
5256
    /**
5257
     * Returns an Observable that emits the item found at a specified index in a sequence of emissions from a
5258
     * source Observable, or a default item if that index is out of range.
5259
     * <p>
5260
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/elementAtOrDefault.png" alt="">
5261
     * <dl>
5262
     *  <dt><b>Scheduler:</b></dt>
5263
     *  <dd>{@code elementAtOrDefault} does not operate by default on a particular {@link Scheduler}.</dd>
5264
     * </dl>
5265
     * 
5266
     * @param index
5267
     *            the zero-based index of the item to retrieve
5268
     * @param defaultValue
5269
     *            the default item
5270
     * @return an Observable that emits the item at the specified position in the sequence emitted by the source
5271
     *         Observable, or the default item if that index is outside the bounds of the source sequence
5272
     * @throws IndexOutOfBoundsException
5273
     *             if {@code index} is less than 0
5274
     * @see <a href="http://reactivex.io/documentation/operators/elementat.html">ReactiveX operators documentation: ElementAt</a>
5275
     */
5276
    public final Observable<T> elementAtOrDefault(int index, T defaultValue) {
5277 1 1. elementAtOrDefault : mutated return of Object value for rx/Observable::elementAtOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorElementAt<T>(index, defaultValue));
5278
    }
5279
5280
    /**
5281
     * Returns an Observable that emits {@code true} if any item emitted by the source Observable satisfies a
5282
     * specified condition, otherwise {@code false}. <em>Note:</em> this always emits {@code false} if the
5283
     * source Observable is empty.
5284
     * <p>
5285
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/exists.png" alt="">
5286
     * <p>
5287
     * In Rx.Net this is the {@code any} Observer but we renamed it in RxJava to better match Java naming
5288
     * idioms.
5289
     * <dl>
5290
     *  <dt><b>Scheduler:</b></dt>
5291
     *  <dd>{@code exists} does not operate by default on a particular {@link Scheduler}.</dd>
5292
     * </dl>
5293
     * 
5294
     * @param predicate
5295
     *            the condition to test items emitted by the source Observable
5296
     * @return an Observable that emits a Boolean that indicates whether any item emitted by the source
5297
     *         Observable satisfies the {@code predicate}
5298
     * @see <a href="http://reactivex.io/documentation/operators/contains.html">ReactiveX operators documentation: Contains</a>
5299
     */
5300
    public final Observable<Boolean> exists(Func1<? super T, Boolean> predicate) {
5301 1 1. exists : mutated return of Object value for rx/Observable::exists to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorAny<T>(predicate, false));
5302
    }
5303
5304
    /**
5305
     * Filters items emitted by an Observable by only emitting those that satisfy a specified predicate.
5306
     * <p>
5307
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/filter.png" alt="">
5308
     * <dl>
5309
     *  <dt><b>Scheduler:</b></dt>
5310
     *  <dd>{@code filter} does not operate by default on a particular {@link Scheduler}.</dd>
5311
     * </dl>
5312
     * 
5313
     * @param predicate
5314
     *            a function that evaluates each item emitted by the source Observable, returning {@code true}
5315
     *            if it passes the filter
5316
     * @return an Observable that emits only those items emitted by the source Observable that the filter
5317
     *         evaluates as {@code true}
5318
     * @see <a href="http://reactivex.io/documentation/operators/filter.html">ReactiveX operators documentation: Filter</a>
5319
     */
5320
    public final Observable<T> filter(Func1<? super T, Boolean> predicate) {
5321 1 1. filter : mutated return of Object value for rx/Observable::filter to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorFilter<T>(predicate));
5322
    }
5323
5324
    /**
5325
     * Registers an {@link Action0} to be called when this Observable invokes either
5326
     * {@link Observer#onCompleted onCompleted} or {@link Observer#onError onError}.
5327
     * <p>
5328
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/finallyDo.png" alt="">
5329
     * <dl>
5330
     *  <dt><b>Scheduler:</b></dt>
5331
     *  <dd>{@code finallyDo} does not operate by default on a particular {@link Scheduler}.</dd>
5332
     * </dl>
5333
     * 
5334
     * @param action
5335
     *            an {@link Action0} to be invoked when the source Observable finishes
5336
     * @return an Observable that emits the same items as the source Observable, then invokes the
5337
     *         {@link Action0}
5338
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
5339
     * @see #doOnTerminate(Action0)
5340
     * @deprecated use {@link #doAfterTerminate(Action0)} instead.
5341
     */
5342
    @Deprecated
5343
    public final Observable<T> finallyDo(Action0 action) {
5344 1 1. finallyDo : mutated return of Object value for rx/Observable::finallyDo to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return lift(new OperatorDoAfterTerminate<T>(action));
5345
    }
5346
5347
    /**
5348
     * Registers an {@link Action0} to be called when this Observable invokes either
5349
     * {@link Observer#onCompleted onCompleted} or {@link Observer#onError onError}.
5350
     * <p>
5351
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/finallyDo.png" alt="">
5352
     * <dl>
5353
     *  <dt><b>Scheduler:</b></dt>
5354
     *  <dd>{@code doAfterTerminate} does not operate by default on a particular {@link Scheduler}.</dd>
5355
     * </dl>
5356
     *
5357
     * @param action
5358
     *            an {@link Action0} to be invoked when the source Observable finishes
5359
     * @return an Observable that emits the same items as the source Observable, then invokes the
5360
     *         {@link Action0}
5361
     * @see <a href="http://reactivex.io/documentation/operators/do.html">ReactiveX operators documentation: Do</a>
5362
     * @see #doOnTerminate(Action0)
5363
     */
5364
    public final Observable<T> doAfterTerminate(Action0 action) {
5365 1 1. doAfterTerminate : mutated return of Object value for rx/Observable::doAfterTerminate to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorDoAfterTerminate<T>(action));
5366
    }
5367
5368
    /**
5369
     * Returns an Observable that emits only the very first item emitted by the source Observable, or notifies
5370
     * of an {@code NoSuchElementException} if the source Observable is empty.
5371
     * <p>
5372
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/first.png" alt="">
5373
     * <dl>
5374
     *  <dt><b>Scheduler:</b></dt>
5375
     *  <dd>{@code first} does not operate by default on a particular {@link Scheduler}.</dd>
5376
     * </dl>
5377
     * 
5378
     * @return an Observable that emits only the very first item emitted by the source Observable, or raises an
5379
     *         {@code NoSuchElementException} if the source Observable is empty
5380
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
5381
     */
5382
    public final Observable<T> first() {
5383 1 1. first : mutated return of Object value for rx/Observable::first to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return take(1).single();
5384
    }
5385
5386
    /**
5387
     * Returns an Observable that emits only the very first item emitted by the source Observable that satisfies
5388
     * a specified condition, or notifies of an {@code NoSuchElementException} if no such items are emitted.
5389
     * <p>
5390
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/firstN.png" alt="">
5391
     * <dl>
5392
     *  <dt><b>Scheduler:</b></dt>
5393
     *  <dd>{@code first} does not operate by default on a particular {@link Scheduler}.</dd>
5394
     * </dl>
5395
     * 
5396
     * @param predicate
5397
     *            the condition that an item emitted by the source Observable has to satisfy
5398
     * @return an Observable that emits only the very first item emitted by the source Observable that satisfies
5399
     *         the {@code predicate}, or raises an {@code NoSuchElementException} if no such items are emitted
5400
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
5401
     */
5402
    public final Observable<T> first(Func1<? super T, Boolean> predicate) {
5403 1 1. first : mutated return of Object value for rx/Observable::first to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return takeFirst(predicate).single();
5404
    }
5405
5406
    /**
5407
     * Returns an Observable that emits only the very first item emitted by the source Observable, or a default
5408
     * item if the source Observable completes without emitting anything.
5409
     * <p>
5410
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/firstOrDefault.png" alt="">
5411
     * <dl>
5412
     *  <dt><b>Scheduler:</b></dt>
5413
     *  <dd>{@code firstOrDefault} does not operate by default on a particular {@link Scheduler}.</dd>
5414
     * </dl>
5415
     * 
5416
     * @param defaultValue
5417
     *            the default item to emit if the source Observable doesn't emit anything
5418
     * @return an Observable that emits only the very first item from the source, or a default item if the
5419
     *         source Observable completes without emitting any items
5420
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
5421
     */
5422
    public final Observable<T> firstOrDefault(T defaultValue) {
5423 1 1. firstOrDefault : mutated return of Object value for rx/Observable::firstOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return take(1).singleOrDefault(defaultValue);
5424
    }
5425
5426
    /**
5427
     * Returns an Observable that emits only the very first item emitted by the source Observable that satisfies
5428
     * a specified condition, or a default item if the source Observable emits no such items.
5429
     * <p>
5430
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/firstOrDefaultN.png" alt="">
5431
     * <dl>
5432
     *  <dt><b>Scheduler:</b></dt>
5433
     *  <dd>{@code firstOrDefault} does not operate by default on a particular {@link Scheduler}.</dd>
5434
     * </dl>
5435
     * 
5436
     * @param predicate
5437
     *            the condition any item emitted by the source Observable has to satisfy
5438
     * @param defaultValue
5439
     *            the default item to emit if the source Observable doesn't emit anything that satisfies the
5440
     *            {@code predicate}
5441
     * @return an Observable that emits only the very first item emitted by the source Observable that satisfies
5442
     *         the {@code predicate}, or a default item if the source Observable emits no such items
5443
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
5444
     */
5445
    public final Observable<T> firstOrDefault(T defaultValue, Func1<? super T, Boolean> predicate) {
5446 1 1. firstOrDefault : mutated return of Object value for rx/Observable::firstOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return takeFirst(predicate).singleOrDefault(defaultValue);
5447
    }
5448
5449
    /**
5450
     * Returns an Observable that emits items based on applying a function that you supply to each item emitted
5451
     * by the source Observable, where that function returns an Observable, and then merging those resulting
5452
     * Observables and emitting the results of this merger.
5453
     * <p>
5454
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/flatMap.png" alt="">
5455
     * <dl>
5456
     *  <dt><b>Scheduler:</b></dt>
5457
     *  <dd>{@code flatMap} does not operate by default on a particular {@link Scheduler}.</dd>
5458
     * </dl>
5459
     * 
5460
     * @param func
5461
     *            a function that, when applied to an item emitted by the source Observable, returns an
5462
     *            Observable
5463
     * @return an Observable that emits the result of applying the transformation function to each item emitted
5464
     *         by the source Observable and merging the results of the Observables obtained from this
5465
     *         transformation
5466
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5467
     */
5468
    public final <R> Observable<R> flatMap(Func1<? super T, ? extends Observable<? extends R>> func) {
5469 1 1. flatMap : negated conditional → KILLED
        if (getClass() == ScalarSynchronousObservable.class) {
5470 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return ((ScalarSynchronousObservable<T>)this).scalarFlatMap(func);
5471
        }
5472 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(map(func));
5473
    }
5474
5475
    /**
5476
     * Returns an Observable that emits items based on applying a function that you supply to each item emitted
5477
     * by the source Observable, where that function returns an Observable, and then merging those resulting
5478
     * Observables and emitting the results of this merger, while limiting the maximum number of concurrent
5479
     * subscriptions to these Observables.
5480
     * <p>
5481
     * <!-- <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/flatMap.png" alt=""> -->
5482
     * <dl>
5483
     *  <dt><b>Scheduler:</b></dt>
5484
     *  <dd>{@code flatMap} does not operate by default on a particular {@link Scheduler}.</dd>
5485
     * </dl>
5486
     * 
5487
     * @param func
5488
     *            a function that, when applied to an item emitted by the source Observable, returns an
5489
     *            Observable
5490
     * @param maxConcurrent
5491
     *         the maximum number of Observables that may be subscribed to concurrently
5492
     * @return an Observable that emits the result of applying the transformation function to each item emitted
5493
     *         by the source Observable and merging the results of the Observables obtained from this
5494
     *         transformation
5495
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5496
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5497
     */
5498
    @Beta
5499
    public final <R> Observable<R> flatMap(Func1<? super T, ? extends Observable<? extends R>> func, int maxConcurrent) {
5500 1 1. flatMap : negated conditional → KILLED
        if (getClass() == ScalarSynchronousObservable.class) {
5501 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return ((ScalarSynchronousObservable<T>)this).scalarFlatMap(func);
5502
        }
5503 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(map(func), maxConcurrent);
5504
    }
5505
5506
    /**
5507
     * Returns an Observable that applies a function to each item emitted or notification raised by the source
5508
     * Observable and then flattens the Observables returned from these functions and emits the resulting items.
5509
     * <p>
5510
     * <img width="640" height="410" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMap.nce.png" alt="">
5511
     * <dl>
5512
     *  <dt><b>Scheduler:</b></dt>
5513
     *  <dd>{@code flatMap} does not operate by default on a particular {@link Scheduler}.</dd>
5514
     * </dl>
5515
     * 
5516
     * @param <R>
5517
     *            the result type
5518
     * @param onNext
5519
     *            a function that returns an Observable to merge for each item emitted by the source Observable
5520
     * @param onError
5521
     *            a function that returns an Observable to merge for an onError notification from the source
5522
     *            Observable
5523
     * @param onCompleted
5524
     *            a function that returns an Observable to merge for an onCompleted notification from the source
5525
     *            Observable
5526
     * @return an Observable that emits the results of merging the Observables returned from applying the
5527
     *         specified functions to the emissions and notifications of the source Observable
5528
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5529
     */
5530
    public final <R> Observable<R> flatMap(
5531
            Func1<? super T, ? extends Observable<? extends R>> onNext,
5532
            Func1<? super Throwable, ? extends Observable<? extends R>> onError,
5533
            Func0<? extends Observable<? extends R>> onCompleted) {
5534 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(mapNotification(onNext, onError, onCompleted));
5535
    }
5536
    /**
5537
     * Returns an Observable that applies a function to each item emitted or notification raised by the source
5538
     * Observable and then flattens the Observables returned from these functions and emits the resulting items, 
5539
     * while limiting the maximum number of concurrent subscriptions to these Observables.
5540
     * <p>
5541
     * <!-- <img width="640" height="410" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMap.nce.png" alt=""> -->
5542
     * <dl>
5543
     *  <dt><b>Scheduler:</b></dt>
5544
     *  <dd>{@code flatMap} does not operate by default on a particular {@link Scheduler}.</dd>
5545
     * </dl>
5546
     * 
5547
     * @param <R>
5548
     *            the result type
5549
     * @param onNext
5550
     *            a function that returns an Observable to merge for each item emitted by the source Observable
5551
     * @param onError
5552
     *            a function that returns an Observable to merge for an onError notification from the source
5553
     *            Observable
5554
     * @param onCompleted
5555
     *            a function that returns an Observable to merge for an onCompleted notification from the source
5556
     *            Observable
5557
     * @param maxConcurrent
5558
     *         the maximum number of Observables that may be subscribed to concurrently
5559
     * @return an Observable that emits the results of merging the Observables returned from applying the
5560
     *         specified functions to the emissions and notifications of the source Observable
5561
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5562
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5563
     */
5564
    @Beta
5565
    public final <R> Observable<R> flatMap(
5566
            Func1<? super T, ? extends Observable<? extends R>> onNext,
5567
            Func1<? super Throwable, ? extends Observable<? extends R>> onError,
5568
            Func0<? extends Observable<? extends R>> onCompleted, int maxConcurrent) {
5569 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(mapNotification(onNext, onError, onCompleted), maxConcurrent);
5570
    }
5571
5572
    /**
5573
     * Returns an Observable that emits the results of a specified function to the pair of values emitted by the
5574
     * source Observable and a specified collection Observable.
5575
     * <p>
5576
     * <img width="640" height="390" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMap.r.png" alt="">
5577
     * <dl>
5578
     *  <dt><b>Scheduler:</b></dt>
5579
     *  <dd>{@code flatMap} does not operate by default on a particular {@link Scheduler}.</dd>
5580
     * </dl>
5581
     * 
5582
     * @param <U>
5583
     *            the type of items emitted by the collection Observable
5584
     * @param <R>
5585
     *            the type of items emitted by the resulting Observable
5586
     * @param collectionSelector
5587
     *            a function that returns an Observable for each item emitted by the source Observable
5588
     * @param resultSelector
5589
     *            a function that combines one item emitted by each of the source and collection Observables and
5590
     *            returns an item to be emitted by the resulting Observable
5591
     * @return an Observable that emits the results of applying a function to a pair of values emitted by the
5592
     *         source Observable and the collection Observable
5593
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5594
     */
5595
    public final <U, R> Observable<R> flatMap(final Func1<? super T, ? extends Observable<? extends U>> collectionSelector,
5596
            final Func2<? super T, ? super U, ? extends R> resultSelector) {
5597 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(lift(new OperatorMapPair<T, U, R>(collectionSelector, resultSelector)));
5598
    }
5599
    /**
5600
     * Returns an Observable that emits the results of a specified function to the pair of values emitted by the
5601
     * source Observable and a specified collection Observable, while limiting the maximum number of concurrent
5602
     * subscriptions to these Observables.
5603
     * <p>
5604
     * <!-- <img width="640" height="390" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMap.r.png" alt=""> -->
5605
     * <dl>
5606
     *  <dt><b>Scheduler:</b></dt>
5607
     *  <dd>{@code flatMap} does not operate by default on a particular {@link Scheduler}.</dd>
5608
     * </dl>
5609
     * 
5610
     * @param <U>
5611
     *            the type of items emitted by the collection Observable
5612
     * @param <R>
5613
     *            the type of items emitted by the resulting Observable
5614
     * @param collectionSelector
5615
     *            a function that returns an Observable for each item emitted by the source Observable
5616
     * @param resultSelector
5617
     *            a function that combines one item emitted by each of the source and collection Observables and
5618
     *            returns an item to be emitted by the resulting Observable
5619
     * @param maxConcurrent
5620
     *         the maximum number of Observables that may be subscribed to concurrently
5621
     * @return an Observable that emits the results of applying a function to a pair of values emitted by the
5622
     *         source Observable and the collection Observable
5623
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5624
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5625
     */
5626
    @Beta
5627
    public final <U, R> Observable<R> flatMap(final Func1<? super T, ? extends Observable<? extends U>> collectionSelector,
5628
            final Func2<? super T, ? super U, ? extends R> resultSelector, int maxConcurrent) {
5629 1 1. flatMap : mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(lift(new OperatorMapPair<T, U, R>(collectionSelector, resultSelector)), maxConcurrent);
5630
    }
5631
5632
    /**
5633
     * Returns an Observable that merges each item emitted by the source Observable with the values in an
5634
     * Iterable corresponding to that item that is generated by a selector.
5635
     * <p>
5636
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMapIterable.png" alt="">
5637
     * <dl>
5638
     *  <dt><b>Scheduler:</b></dt>
5639
     *  <dd>{@code flatMapIterable} does not operate by default on a particular {@link Scheduler}.</dd>
5640
     * </dl>
5641
     * 
5642
     * @param <R>
5643
     *            the type of item emitted by the resulting Observable
5644
     * @param collectionSelector
5645
     *            a function that returns an Iterable sequence of values for when given an item emitted by the
5646
     *            source Observable
5647
     * @return an Observable that emits the results of merging the items emitted by the source Observable with
5648
     *         the values in the Iterables corresponding to those items, as generated by {@code collectionSelector}
5649
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5650
     */
5651
    public final <R> Observable<R> flatMapIterable(Func1<? super T, ? extends Iterable<? extends R>> collectionSelector) {
5652 1 1. flatMapIterable : mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(map(OperatorMapPair.convertSelector(collectionSelector)));
5653
    }
5654
5655
    /**
5656
     * Returns an Observable that merges each item emitted by the source Observable with the values in an
5657
     * Iterable corresponding to that item that is generated by a selector, while limiting the number of concurrent
5658
     * subscriptions to these Observables.
5659
     * <p>
5660
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMapIterable.png" alt="">
5661
     * <dl>
5662
     *  <dt><b>Scheduler:</b></dt>
5663
     *  <dd>{@code flatMapIterable} does not operate by default on a particular {@link Scheduler}.</dd>
5664
     * </dl>
5665
     *
5666
     * @param <R>
5667
     *            the type of item emitted by the resulting Observable
5668
     * @param collectionSelector
5669
     *            a function that returns an Iterable sequence of values for when given an item emitted by the
5670
     *            source Observable
5671
     * @param maxConcurrent
5672
     *            the maximum number of Observables that may be subscribed to concurrently
5673
     * @return an Observable that emits the results of merging the items emitted by the source Observable with
5674
     *         the values in the Iterables corresponding to those items, as generated by {@code collectionSelector}
5675
     * @throws IllegalArgumentException
5676
     *             if {@code maxConcurrent} is less than or equal to 0
5677
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5678
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5679
     */
5680
    @Beta
5681
    public final <R> Observable<R> flatMapIterable(Func1<? super T, ? extends Iterable<? extends R>> collectionSelector, int maxConcurrent) {
5682 1 1. flatMapIterable : mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return merge(map(OperatorMapPair.convertSelector(collectionSelector)), maxConcurrent);
5683
    }
5684
    
5685
    /**
5686
     * Returns an Observable that emits the results of applying a function to the pair of values from the source
5687
     * Observable and an Iterable corresponding to that item that is generated by a selector.
5688
     * <p>
5689
     * <img width="640" height="390" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMapIterable.r.png" alt="">
5690
     * <dl>
5691
     *  <dt><b>Scheduler:</b></dt>
5692
     *  <dd>{@code flatMapIterable} does not operate by default on a particular {@link Scheduler}.</dd>
5693
     * </dl>
5694
     * 
5695
     * @param <U>
5696
     *            the collection element type
5697
     * @param <R>
5698
     *            the type of item emited by the resulting Observable
5699
     * @param collectionSelector
5700
     *            a function that returns an Iterable sequence of values for each item emitted by the source
5701
     *            Observable
5702
     * @param resultSelector
5703
     *            a function that returns an item based on the item emitted by the source Observable and the
5704
     *            Iterable returned for that item by the {@code collectionSelector}
5705
     * @return an Observable that emits the items returned by {@code resultSelector} for each item in the source
5706
     *         Observable
5707
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5708
     */
5709
    public final <U, R> Observable<R> flatMapIterable(Func1<? super T, ? extends Iterable<? extends U>> collectionSelector,
5710
            Func2<? super T, ? super U, ? extends R> resultSelector) {
5711 1 1. flatMapIterable : mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return flatMap(OperatorMapPair.convertSelector(collectionSelector), resultSelector);
5712
    }
5713
5714
    /**
5715
     * Returns an Observable that emits the results of applying a function to the pair of values from the source
5716
     * Observable and an Iterable corresponding to that item that is generated by a selector, while limiting the
5717
     * number of concurrent subscriptions to these Observables.
5718
     * <p>
5719
     * <img width="640" height="390" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/mergeMapIterable.r.png" alt="">
5720
     * <dl>
5721
     *  <dt><b>Scheduler:</b></dt>
5722
     *  <dd>{@code flatMapIterable} does not operate by default on a particular {@link Scheduler}.</dd>
5723
     * </dl>
5724
     *
5725
     * @param <U>
5726
     *            the collection element type
5727
     * @param <R>
5728
     *            the type of item emited by the resulting Observable
5729
     * @param collectionSelector
5730
     *            a function that returns an Iterable sequence of values for each item emitted by the source
5731
     *            Observable
5732
     * @param resultSelector
5733
     *            a function that returns an item based on the item emitted by the source Observable and the
5734
     *            Iterable returned for that item by the {@code collectionSelector}
5735
     * @param maxConcurrent
5736
     *            the maximum number of Observables that may be subscribed to concurrently
5737
     * @return an Observable that emits the items returned by {@code resultSelector} for each item in the source
5738
     *         Observable
5739
     * @throws IllegalArgumentException
5740
     *             if {@code maxConcurrent} is less than or equal to 0
5741
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
5742
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
5743
     */
5744
    @Beta
5745
    public final <U, R> Observable<R> flatMapIterable(Func1<? super T, ? extends Iterable<? extends U>> collectionSelector,
5746
            Func2<? super T, ? super U, ? extends R> resultSelector, int maxConcurrent) {
5747 1 1. flatMapIterable : mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return flatMap(OperatorMapPair.convertSelector(collectionSelector), resultSelector, maxConcurrent);
5748
    }
5749
5750
    /**
5751
     * Subscribes to the {@link Observable} and receives notifications for each element.
5752
     * <p>
5753
     * Alias to {@link #subscribe(Action1)}
5754
     * <dl>
5755
     *  <dt><b>Scheduler:</b></dt>
5756
     *  <dd>{@code forEach} does not operate by default on a particular {@link Scheduler}.</dd>
5757
     * </dl>
5758
     * 
5759
     * @param onNext
5760
     *            {@link Action1} to execute for each item.
5761
     * @throws IllegalArgumentException
5762
     *             if {@code onNext} is null
5763
     * @throws OnErrorNotImplementedException
5764
     *             if the Observable calls {@code onError}
5765
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
5766
     */
5767
    public final void forEach(final Action1<? super T> onNext) {
5768
        subscribe(onNext);
5769
    }
5770
    
5771
    /**
5772
     * Subscribes to the {@link Observable} and receives notifications for each element and error events.
5773
     * <p>
5774
     * Alias to {@link #subscribe(Action1, Action1)}
5775
     * <dl>
5776
     *  <dt><b>Scheduler:</b></dt>
5777
     *  <dd>{@code forEach} does not operate by default on a particular {@link Scheduler}.</dd>
5778
     * </dl>
5779
     * 
5780
     * @param onNext
5781
     *            {@link Action1} to execute for each item.
5782
     * @param onError
5783
     *            {@link Action1} to execute when an error is emitted.
5784
     * @throws IllegalArgumentException
5785
     *             if {@code onNext} is null, or
5786
     *             if {@code onError} is null
5787
     * @throws OnErrorNotImplementedException
5788
     *             if the Observable calls {@code onError}
5789
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
5790
     */
5791
    public final void forEach(final Action1<? super T> onNext, final Action1<Throwable> onError) {
5792
        subscribe(onNext, onError);
5793
    }
5794
    
5795
    /**
5796
     * Subscribes to the {@link Observable} and receives notifications for each element and the terminal events.
5797
     * <p>
5798
     * Alias to {@link #subscribe(Action1, Action1, Action0)}
5799
     * <dl>
5800
     *  <dt><b>Scheduler:</b></dt>
5801
     *  <dd>{@code forEach} does not operate by default on a particular {@link Scheduler}.</dd>
5802
     * </dl>
5803
     * 
5804
     * @param onNext
5805
     *            {@link Action1} to execute for each item.
5806
     * @param onError
5807
     *            {@link Action1} to execute when an error is emitted.
5808
     * @param onComplete
5809
     *            {@link Action0} to execute when completion is signalled.
5810
     * @throws IllegalArgumentException
5811
     *             if {@code onNext} is null, or
5812
     *             if {@code onError} is null, or
5813
     *             if {@code onComplete} is null
5814
     * @throws OnErrorNotImplementedException
5815
     *             if the Observable calls {@code onError}
5816
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
5817
     */
5818
    public final void forEach(final Action1<? super T> onNext, final Action1<Throwable> onError, final Action0 onComplete) {
5819
        subscribe(onNext, onError, onComplete);
5820
    }
5821
    
5822
    /**
5823
     * Groups the items emitted by an {@code Observable} according to a specified criterion, and emits these
5824
     * grouped items as {@link GroupedObservable}s. The emitted {@code GroupedObservable} allows only a single 
5825
     * {@link Subscriber} during its lifetime and if this {@code Subscriber} unsubscribes before the 
5826
     * source terminates, the next emission by the source having the same key will trigger a new 
5827
     * {@code GroupedObservable} emission.
5828
     * <p>
5829
     * <img width="640" height="360" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/groupBy.png" alt="">
5830
     * <p>
5831
     * <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
5832
     * is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
5833
     * {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
5834
     * discard their buffers by applying an operator like {@link #ignoreElements} to them.
5835
     * <dl>
5836
     *  <dt><b>Scheduler:</b></dt>
5837
     *  <dd>{@code groupBy} does not operate by default on a particular {@link Scheduler}.</dd>
5838
     * </dl>
5839
     * 
5840
     * @param keySelector
5841
     *            a function that extracts the key for each item
5842
     * @param elementSelector
5843
     *            a function that extracts the return element for each item
5844
     * @param <K>
5845
     *            the key type
5846
     * @param <R>
5847
     *            the element type
5848
     * @return an {@code Observable} that emits {@link GroupedObservable}s, each of which corresponds to a
5849
     *         unique key value and each of which emits those items from the source Observable that share that
5850
     *         key value
5851
     * @see <a href="http://reactivex.io/documentation/operators/groupby.html">ReactiveX operators documentation: GroupBy</a>
5852
     */
5853
    public final <K, R> Observable<GroupedObservable<K, R>> groupBy(final Func1<? super T, ? extends K> keySelector, final Func1<? super T, ? extends R> elementSelector) {
5854 1 1. groupBy : mutated return of Object value for rx/Observable::groupBy to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorGroupBy<T, K, R>(keySelector, elementSelector));
5855
    }
5856
    
5857
    /**
5858
     * Groups the items emitted by an {@code Observable} according to a specified criterion, and emits these
5859
     * grouped items as {@link GroupedObservable}s. The emitted {@code GroupedObservable} allows only a single 
5860
     * {@link Subscriber} during its lifetime and if this {@code Subscriber} unsubscribes before the 
5861
     * source terminates, the next emission by the source having the same key will trigger a new 
5862
     * {@code GroupedObservable} emission.
5863
     * <p>
5864
     * <img width="640" height="360" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/groupBy.png" alt="">
5865
     * <p>
5866
     * <em>Note:</em> A {@link GroupedObservable} will cache the items it is to emit until such time as it
5867
     * is subscribed to. For this reason, in order to avoid memory leaks, you should not simply ignore those
5868
     * {@code GroupedObservable}s that do not concern you. Instead, you can signal to them that they may
5869
     * discard their buffers by applying an operator like {@link #ignoreElements} to them.
5870
     * <dl>
5871
     *  <dt><b>Scheduler:</b></dt>
5872
     *  <dd>{@code groupBy} does not operate by default on a particular {@link Scheduler}.</dd>
5873
     * </dl>
5874
     * 
5875
     * @param keySelector
5876
     *            a function that extracts the key for each item
5877
     * @param <K>
5878
     *            the key type
5879
     * @return an {@code Observable} that emits {@link GroupedObservable}s, each of which corresponds to a
5880
     *         unique key value and each of which emits those items from the source Observable that share that
5881
     *         key value
5882
     * @see <a href="http://reactivex.io/documentation/operators/groupby.html">ReactiveX operators documentation: GroupBy</a>
5883
     */
5884
    public final <K> Observable<GroupedObservable<K, T>> groupBy(final Func1<? super T, ? extends K> keySelector) {
5885 1 1. groupBy : mutated return of Object value for rx/Observable::groupBy to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorGroupBy<T, K, T>(keySelector));
5886
    }
5887
5888
    /**
5889
     * Returns an Observable that correlates two Observables when they overlap in time and groups the results.
5890
     * <p>
5891
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/groupJoin.png" alt="">
5892
     * <dl>
5893
     *  <dt><b>Scheduler:</b></dt>
5894
     *  <dd>{@code groupJoin} does not operate by default on a particular {@link Scheduler}.</dd>
5895
     * </dl>
5896
     * 
5897
     * @param right
5898
     *            the other Observable to correlate items from the source Observable with
5899
     * @param leftDuration
5900
     *            a function that returns an Observable whose emissions indicate the duration of the values of
5901
     *            the source Observable
5902
     * @param rightDuration
5903
     *            a function that returns an Observable whose emissions indicate the duration of the values of
5904
     *            the {@code right} Observable
5905
     * @param resultSelector
5906
     *            a function that takes an item emitted by each Observable and returns the value to be emitted
5907
     *            by the resulting Observable
5908
     * @return an Observable that emits items based on combining those items emitted by the source Observables
5909
     *         whose durations overlap
5910
     * @see <a href="http://reactivex.io/documentation/operators/join.html">ReactiveX operators documentation: Join</a>
5911
     */
5912
    public final <T2, D1, D2, R> Observable<R> groupJoin(Observable<T2> right, Func1<? super T, ? extends Observable<D1>> leftDuration,
5913
            Func1<? super T2, ? extends Observable<D2>> rightDuration,
5914
            Func2<? super T, ? super Observable<T2>, ? extends R> resultSelector) {
5915 1 1. groupJoin : mutated return of Object value for rx/Observable::groupJoin to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeGroupJoin<T, T2, D1, D2, R>(this, right, leftDuration, rightDuration, resultSelector));
5916
    }
5917
5918
    /**
5919
     * Ignores all items emitted by the source Observable and only calls {@code onCompleted} or {@code onError}.
5920
     * <p>
5921
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/ignoreElements.png" alt="">
5922
     * <dl>
5923
     *  <dt><b>Scheduler:</b></dt>
5924
     *  <dd>{@code ignoreElements} does not operate by default on a particular {@link Scheduler}.</dd>
5925
     * </dl>
5926
     * 
5927
     * @return an empty Observable that only calls {@code onCompleted} or {@code onError}, based on which one is
5928
     *         called by the source Observable
5929
     * @see <a href="http://reactivex.io/documentation/operators/ignoreelements.html">ReactiveX operators documentation: IgnoreElements</a>
5930
     */
5931
    public final Observable<T> ignoreElements() {
5932 1 1. ignoreElements : mutated return of Object value for rx/Observable::ignoreElements to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorIgnoreElements.<T> instance());
5933
    }
5934
5935
    /**
5936
     * Returns an Observable that emits {@code true} if the source Observable is empty, otherwise {@code false}.
5937
     * <p>
5938
     * In Rx.Net this is negated as the {@code any} Observer but we renamed this in RxJava to better match Java
5939
     * naming idioms.
5940
     * <p>
5941
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/isEmpty.png" alt="">
5942
     * <dl>
5943
     *  <dt><b>Scheduler:</b></dt>
5944
     *  <dd>{@code isEmpty} does not operate by default on a particular {@link Scheduler}.</dd>
5945
     * </dl>
5946
     * 
5947
     * @return an Observable that emits a Boolean
5948
     * @see <a href="http://reactivex.io/documentation/operators/contains.html">ReactiveX operators documentation: Contains</a>
5949
     */
5950
    @SuppressWarnings("unchecked")
5951
    public final Observable<Boolean> isEmpty() {
5952 1 1. isEmpty : mutated return of Object value for rx/Observable::isEmpty to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift((OperatorAny<T>) HolderAnyForEmpty.INSTANCE);
5953
    }
5954
    
5955
    private static class HolderAnyForEmpty {
5956
        static final OperatorAny<?> INSTANCE = new OperatorAny<Object>(UtilityFunctions.alwaysTrue(), true);
5957
    }
5958
5959
    /**
5960
     * Correlates the items emitted by two Observables based on overlapping durations.
5961
     * <p>
5962
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/join_.png" alt="">
5963
     * <dl>
5964
     *  <dt><b>Scheduler:</b></dt>
5965
     *  <dd>{@code join} does not operate by default on a particular {@link Scheduler}.</dd>
5966
     * </dl>
5967
     * 
5968
     * @param right
5969
     *            the second Observable to join items from
5970
     * @param leftDurationSelector
5971
     *            a function to select a duration for each item emitted by the source Observable, used to
5972
     *            determine overlap
5973
     * @param rightDurationSelector
5974
     *            a function to select a duration for each item emitted by the {@code right} Observable, used to
5975
     *            determine overlap
5976
     * @param resultSelector
5977
     *            a function that computes an item to be emitted by the resulting Observable for any two
5978
     *            overlapping items emitted by the two Observables
5979
     * @return an Observable that emits items correlating to items emitted by the source Observables that have
5980
     *         overlapping durations
5981
     * @see <a href="http://reactivex.io/documentation/operators/join.html">ReactiveX operators documentation: Join</a>
5982
     */
5983
    public final <TRight, TLeftDuration, TRightDuration, R> Observable<R> join(Observable<TRight> right, Func1<T, Observable<TLeftDuration>> leftDurationSelector,
5984
            Func1<TRight, Observable<TRightDuration>> rightDurationSelector,
5985
            Func2<T, TRight, R> resultSelector) {
5986 1 1. join : mutated return of Object value for rx/Observable::join to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OnSubscribeJoin<T, TRight, TLeftDuration, TRightDuration, R>(this, right, leftDurationSelector, rightDurationSelector, resultSelector));
5987
    }
5988
5989
    /**
5990
     * Returns an Observable that emits the last item emitted by the source Observable or notifies observers of
5991
     * a {@code NoSuchElementException} if the source Observable is empty.
5992
     * <p>
5993
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/last.png" alt="">
5994
     * <dl>
5995
     *  <dt><b>Scheduler:</b></dt>
5996
     *  <dd>{@code last} does not operate by default on a particular {@link Scheduler}.</dd>
5997
     * </dl>
5998
     * 
5999
     * @return an Observable that emits the last item from the source Observable or notifies observers of an
6000
     *         error
6001
     * @see <a href="http://reactivex.io/documentation/operators/last.html">ReactiveX operators documentation: Last</a>
6002
     */
6003
    public final Observable<T> last() {
6004 1 1. last : mutated return of Object value for rx/Observable::last to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return takeLast(1).single();
6005
    }
6006
6007
    /**
6008
     * Returns an Observable that emits only the last item emitted by the source Observable that satisfies a
6009
     * given condition, or notifies of a {@code NoSuchElementException} if no such items are emitted.
6010
     * <p>
6011
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/last.p.png" alt="">
6012
     * <dl>
6013
     *  <dt><b>Scheduler:</b></dt>
6014
     *  <dd>{@code last} does not operate by default on a particular {@link Scheduler}.</dd>
6015
     * </dl>
6016
     * 
6017
     * @param predicate
6018
     *            the condition any source emitted item has to satisfy
6019
     * @return an Observable that emits only the last item satisfying the given condition from the source, or an
6020
     *         {@code NoSuchElementException} if no such items are emitted
6021
     * @throws IllegalArgumentException
6022
     *             if no items that match the predicate are emitted by the source Observable
6023
     * @see <a href="http://reactivex.io/documentation/operators/last.html">ReactiveX operators documentation: Last</a>
6024
     */
6025
    public final Observable<T> last(Func1<? super T, Boolean> predicate) {
6026 1 1. last : mutated return of Object value for rx/Observable::last to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return filter(predicate).takeLast(1).single();
6027
    }
6028
6029
    /**
6030
     * Returns an Observable that emits only the last item emitted by the source Observable, or a default item
6031
     * if the source Observable completes without emitting any items.
6032
     * <p>
6033
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/lastOrDefault.png" alt="">
6034
     * <dl>
6035
     *  <dt><b>Scheduler:</b></dt>
6036
     *  <dd>{@code lastOrDefault} does not operate by default on a particular {@link Scheduler}.</dd>
6037
     * </dl>
6038
     * 
6039
     * @param defaultValue
6040
     *            the default item to emit if the source Observable is empty
6041
     * @return an Observable that emits only the last item emitted by the source Observable, or a default item
6042
     *         if the source Observable is empty
6043
     * @see <a href="http://reactivex.io/documentation/operators/last.html">ReactiveX operators documentation: Last</a>
6044
     */
6045
    public final Observable<T> lastOrDefault(T defaultValue) {
6046 1 1. lastOrDefault : mutated return of Object value for rx/Observable::lastOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return takeLast(1).singleOrDefault(defaultValue);
6047
    }
6048
6049
    /**
6050
     * Returns an Observable that emits only the last item emitted by the source Observable that satisfies a
6051
     * specified condition, or a default item if no such item is emitted by the source Observable.
6052
     * <p>
6053
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/lastOrDefault.p.png" alt="">
6054
     * <dl>
6055
     *  <dt><b>Scheduler:</b></dt>
6056
     *  <dd>{@code lastOrDefault} does not operate by default on a particular {@link Scheduler}.</dd>
6057
     * </dl>
6058
     * 
6059
     * @param defaultValue
6060
     *            the default item to emit if the source Observable doesn't emit anything that satisfies the
6061
     *            specified {@code predicate}
6062
     * @param predicate
6063
     *            the condition any item emitted by the source Observable has to satisfy
6064
     * @return an Observable that emits only the last item emitted by the source Observable that satisfies the
6065
     *         given condition, or a default item if no such item is emitted by the source Observable
6066
     * @see <a href="http://reactivex.io/documentation/operators/last.html">ReactiveX operators documentation: Last</a>
6067
     */
6068
    public final Observable<T> lastOrDefault(T defaultValue, Func1<? super T, Boolean> predicate) {
6069 1 1. lastOrDefault : mutated return of Object value for rx/Observable::lastOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return filter(predicate).takeLast(1).singleOrDefault(defaultValue);
6070
    }
6071
6072
    /**
6073
     * Returns an Observable that emits only the first {@code count} items emitted by the source Observable.
6074
     * <p>
6075
     * Alias of {@link #take(int)} to match Java 8 Stream API naming convention.
6076
     * <p>
6077
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/take.png" alt="">
6078
     * <p>
6079
     * This method returns an Observable that will invoke a subscribing {@link Observer}'s
6080
     * {@link Observer#onNext onNext} function a maximum of {@code count} times before invoking
6081
     * {@link Observer#onCompleted onCompleted}.
6082
     * <dl>
6083
     *  <dt><b>Scheduler:</b></dt>
6084
     *  <dd>{@code limit} does not operate by default on a particular {@link Scheduler}.</dd>
6085
     * </dl>
6086
     * 
6087
     * @param count
6088
     *            the maximum number of items to emit
6089
     * @return an Observable that emits only the first {@code count} items emitted by the source Observable, or
6090
     *         all of the items from the source Observable if that Observable emits fewer than {@code count} items
6091
     * @see <a href="http://reactivex.io/documentation/operators/take.html">ReactiveX operators documentation: Take</a>
6092
     */
6093
    public final Observable<T> limit(int count) {
6094 1 1. limit : mutated return of Object value for rx/Observable::limit to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
        return take(count);
6095
    }
6096
    
6097
    /**
6098
     * Returns an Observable that applies a specified function to each item emitted by the source Observable and
6099
     * emits the results of these function applications.
6100
     * <p>
6101
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/map.png" alt="">
6102
     * <dl>
6103
     *  <dt><b>Scheduler:</b></dt>
6104
     *  <dd>{@code map} does not operate by default on a particular {@link Scheduler}.</dd>
6105
     * </dl>
6106
     * 
6107
     * @param func
6108
     *            a function to apply to each item emitted by the Observable
6109
     * @return an Observable that emits the items from the source Observable, transformed by the specified
6110
     *         function
6111
     * @see <a href="http://reactivex.io/documentation/operators/map.html">ReactiveX operators documentation: Map</a>
6112
     */
6113
    public final <R> Observable<R> map(Func1<? super T, ? extends R> func) {
6114 1 1. map : mutated return of Object value for rx/Observable::map to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorMap<T, R>(func));
6115
    }
6116
    
6117
    private <R> Observable<R> mapNotification(Func1<? super T, ? extends R> onNext, Func1<? super Throwable, ? extends R> onError, Func0<? extends R> onCompleted) {
6118 1 1. mapNotification : mutated return of Object value for rx/Observable::mapNotification to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorMapNotification<T, R>(onNext, onError, onCompleted));
6119
    }
6120
6121
    /**
6122
     * Returns an Observable that represents all of the emissions <em>and</em> notifications from the source
6123
     * Observable into emissions marked with their original types within {@link Notification} objects.
6124
     * <p>
6125
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/materialize.png" alt="">
6126
     * <dl>
6127
     *  <dt><b>Scheduler:</b></dt>
6128
     *  <dd>{@code materialize} does not operate by default on a particular {@link Scheduler}.</dd>
6129
     * </dl>
6130
     * 
6131
     * @return an Observable that emits items that are the result of materializing the items and notifications
6132
     *         of the source Observable
6133
     * @see <a href="http://reactivex.io/documentation/operators/materialize-dematerialize.html">ReactiveX operators documentation: Materialize</a>
6134
     */
6135
    public final Observable<Notification<T>> materialize() {
6136 1 1. materialize : mutated return of Object value for rx/Observable::materialize to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorMaterialize.<T>instance());
6137
    }
6138
6139
    /**
6140
     * Flattens this and another Observable into a single Observable, without any transformation.
6141
     * <p>
6142
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/merge.png" alt="">
6143
     * <p>
6144
     * You can combine items emitted by multiple Observables so that they appear as a single Observable, by
6145
     * using the {@code mergeWith} method.
6146
     * <dl>
6147
     *  <dt><b>Scheduler:</b></dt>
6148
     *  <dd>{@code mergeWith} does not operate by default on a particular {@link Scheduler}.</dd>
6149
     * </dl>
6150
     * 
6151
     * @param t1
6152
     *            an Observable to be merged
6153
     * @return an Observable that emits all of the items emitted by the source Observables
6154
     * @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
6155
     */
6156
    public final Observable<T> mergeWith(Observable<? extends T> t1) {
6157 1 1. mergeWith : mutated return of Object value for rx/Observable::mergeWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return merge(this, t1);
6158
    }
6159
    
6160
    /**
6161
     * Modifies an Observable to perform its emissions and notifications on a specified {@link Scheduler},
6162
     * asynchronously with a bounded buffer.
6163
     * <p>Note that onError notifications will cut ahead of onNext notifications on the emission thread if Scheduler is truly
6164
     * asynchronous. If strict event ordering is required, consider using the {@link #observeOn(Scheduler, boolean)} overload.
6165
     * <p>
6166
     * <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
6167
     * <dl>
6168
     *  <dt><b>Scheduler:</b></dt>
6169
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
6170
     * </dl>
6171
     * 
6172
     * @param scheduler
6173
     *            the {@link Scheduler} to notify {@link Observer}s on
6174
     * @return the source Observable modified so that its {@link Observer}s are notified on the specified
6175
     *         {@link Scheduler}
6176
     * @see <a href="http://reactivex.io/documentation/operators/observeon.html">ReactiveX operators documentation: ObserveOn</a>
6177
     * @see <a href="http://www.grahamlea.com/2014/07/rxjava-threading-examples/">RxJava Threading Examples</a>
6178
     * @see #subscribeOn
6179
     * @see #observeOn(Scheduler, boolean)
6180
     */
6181
    public final Observable<T> observeOn(Scheduler scheduler) {
6182 1 1. observeOn : negated conditional → KILLED
        if (this instanceof ScalarSynchronousObservable) {
6183 1 1. observeOn : mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return ((ScalarSynchronousObservable<T>)this).scalarScheduleOn(scheduler);
6184
        }
6185 1 1. observeOn : mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorObserveOn<T>(scheduler, false));
6186
    }
6187
6188
    /**
6189
     * Modifies an Observable to perform its emissions and notifications on a specified {@link Scheduler},
6190
     * asynchronously with a bounded buffer and optionally delays onError notifications.
6191
     * <p>
6192
     * <img width="640" height="308" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/observeOn.png" alt="">
6193
     * <dl>
6194
     *  <dt><b>Scheduler:</b></dt>
6195
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
6196
     * </dl>
6197
     * 
6198
     * @param scheduler
6199
     *            the {@link Scheduler} to notify {@link Observer}s on
6200
     * @param delayError
6201
     *            indicates if the onError notification may not cut ahead of onNext notification on the other side of the
6202
     *            scheduling boundary. If true a sequence ending in onError will be replayed in the same order as was received
6203
     *            from upstream
6204
     * @return the source Observable modified so that its {@link Observer}s are notified on the specified
6205
     *         {@link Scheduler}
6206
     * @see <a href="http://reactivex.io/documentation/operators/observeon.html">ReactiveX operators documentation: ObserveOn</a>
6207
     * @see <a href="http://www.grahamlea.com/2014/07/rxjava-threading-examples/">RxJava Threading Examples</a>
6208
     * @see #subscribeOn
6209
     * @see #observeOn(Scheduler)
6210
     */
6211
    public final Observable<T> observeOn(Scheduler scheduler, boolean delayError) {
6212 1 1. observeOn : negated conditional → KILLED
        if (this instanceof ScalarSynchronousObservable) {
6213 1 1. observeOn : mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
            return ((ScalarSynchronousObservable<T>)this).scalarScheduleOn(scheduler);
6214
        }
6215 1 1. observeOn : mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorObserveOn<T>(scheduler, delayError));
6216
    }
6217
6218
    /**
6219
     * Filters the items emitted by an Observable, only emitting those of the specified type.
6220
     * <p>
6221
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/ofClass.png" alt="">
6222
     * <dl>
6223
     *  <dt><b>Scheduler:</b></dt>
6224
     *  <dd>{@code ofType} does not operate by default on a particular {@link Scheduler}.</dd>
6225
     * </dl>
6226
     * 
6227
     * @param klass
6228
     *            the class type to filter the items emitted by the source Observable
6229
     * @return an Observable that emits items from the source Observable of type {@code klass}
6230
     * @see <a href="http://reactivex.io/documentation/operators/filter.html">ReactiveX operators documentation: Filter</a>
6231
     */
6232
    public final <R> Observable<R> ofType(final Class<R> klass) {
6233 1 1. ofType : mutated return of Object value for rx/Observable::ofType to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return filter(new Func1<T, Boolean>() {
6234
            @Override
6235
            public final Boolean call(T t) {
6236 1 1. call : mutated return of Object value for rx/Observable$13::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return klass.isInstance(t);
6237
            }
6238
        }).cast(klass);
6239
    }
6240
6241
    /**
6242
     * Instructs an Observable that is emitting items faster than its observer can consume them to buffer these
6243
     * items indefinitely until they can be emitted.
6244
     * <p>
6245
     * <img width="640" height="300" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/bp.obp.buffer.png" alt="">
6246
     * <dl>
6247
     *  <dt><b>Scheduler:</b></dt>
6248
     *  <dd>{@code onBackpressureBuffer} does not operate by default on a particular {@link Scheduler}.</dd>
6249
     * </dl>
6250
     *
6251
     * @return the source Observable modified to buffer items to the extent system resources allow
6252
     * @see <a href="http://reactivex.io/documentation/operators/backpressure.html">ReactiveX operators documentation: backpressure operators</a>
6253
     */
6254
    public final Observable<T> onBackpressureBuffer() {
6255 1 1. onBackpressureBuffer : mutated return of Object value for rx/Observable::onBackpressureBuffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorOnBackpressureBuffer.<T> instance());
6256
    }
6257
6258
    /**
6259
     * Instructs an Observable that is emitting items faster than its observer can consume them to buffer up to
6260
     * a given amount of items until they can be emitted. The resulting Observable will {@code onError} emitting
6261
     * a {@code BufferOverflowException} as soon as the buffer's capacity is exceeded, dropping all undelivered
6262
     * items, and unsubscribing from the source.
6263
     * <p>
6264
     * <img width="640" height="300" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/bp.obp.buffer.png" alt="">
6265
     * <dl>
6266
     *  <dt><b>Scheduler:</b></dt>
6267
     *  <dd>{@code onBackpressureBuffer} does not operate by default on a particular {@link Scheduler}.</dd>
6268
     * </dl>
6269
     *
6270
     * @return the source Observable modified to buffer items up to the given capacity
6271
     * @see <a href="http://reactivex.io/documentation/operators/backpressure.html">ReactiveX operators documentation: backpressure operators</a>
6272
     * @since 1.1.0
6273
     */
6274
    public final Observable<T> onBackpressureBuffer(long capacity) {
6275 1 1. onBackpressureBuffer : mutated return of Object value for rx/Observable::onBackpressureBuffer to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
        return lift(new OperatorOnBackpressureBuffer<T>(capacity));
6276
    }
6277
6278
    /**
6279
     * Instructs an Observable that is emitting items faster than its observer can consume them to buffer up to
6280
     * a given amount of items until they can be emitted. The resulting Observable will {@code onError} emitting
6281
     * a {@code BufferOverflowException} as soon as the buffer's capacity is exceeded, dropping all undelivered
6282
     * items, unsubscribing from the source, and notifying the producer with {@code onOverflow}.
6283
     * <p>
6284
     * <img width="640" height="300" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/bp.obp.buffer.png" alt="">
6285
     * <dl>
6286
     *  <dt><b>Scheduler:</b></dt>
6287
     *  <dd>{@code onBackpressureBuffer} does not operate by default on a particular {@link Scheduler}.</dd>
6288
     * </dl>
6289
     *
6290
     * @return the source Observable modified to buffer items up to the given capacity
6291
     * @see <a href="http://reactivex.io/documentation/operators/backpressure.html">ReactiveX operators documentation: backpressure operators</a>
6292
     * @since 1.1.0
6293
     */
6294
    public final Observable<T> onBackpressureBuffer(long capacity, Action0 onOverflow) {
6295 1 1. onBackpressureBuffer : mutated return of Object value for rx/Observable::onBackpressureBuffer to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorOnBackpressureBuffer<T>(capacity, onOverflow));
6296
    }
6297
6298
    /**
6299
     * Instructs an Observable that is emitting items faster than its observer can consume them to discard,
6300
     * rather than emit, those items that its observer is not prepared to observe.
6301
     * <p>
6302
     * <img width="640" height="245" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/bp.obp.drop.png" alt="">
6303
     * <p>
6304
     * If the downstream request count hits 0 then the Observable will refrain from calling {@code onNext} until
6305
     * the observer invokes {@code request(n)} again to increase the request count.
6306
     * <dl>
6307
     *  <dt><b>Scheduler:</b></dt>
6308
     *  <dd>{@code onBackpressureDrop} does not operate by default on a particular {@link Scheduler}.</dd>
6309
     * </dl>
6310
     *
6311
     * @param onDrop the action to invoke for each item dropped. onDrop action should be fast and should never block.
6312
     * @return the source Observable modified to drop {@code onNext} notifications on overflow
6313
     * @see <a href="http://reactivex.io/documentation/operators/backpressure.html">ReactiveX operators documentation: backpressure operators</a>
6314
     * @Experimental The behavior of this can change at any time. 
6315
     * @since 1.1.0
6316
     */
6317
    public final Observable<T> onBackpressureDrop(Action1<? super T> onDrop) {
6318 1 1. onBackpressureDrop : mutated return of Object value for rx/Observable::onBackpressureDrop to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorOnBackpressureDrop<T>(onDrop));
6319
    }
6320
6321
    /**
6322
     * Instructs an Observable that is emitting items faster than its observer can consume them to discard,
6323
     * rather than emit, those items that its observer is not prepared to observe.
6324
     * <p>
6325
     * <img width="640" height="245" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/bp.obp.drop.png" alt="">
6326
     * <p>
6327
     * If the downstream request count hits 0 then the Observable will refrain from calling {@code onNext} until
6328
     * the observer invokes {@code request(n)} again to increase the request count.
6329
     * <dl>
6330
     *  <dt><b>Scheduler:</b></dt>
6331
     *  <dd>{@code onBackpressureDrop} does not operate by default on a particular {@link Scheduler}.</dd>
6332
     * </dl>
6333
     * 
6334
     * @return the source Observable modified to drop {@code onNext} notifications on overflow
6335
     * @see <a href="http://reactivex.io/documentation/operators/backpressure.html">ReactiveX operators documentation: backpressure operators</a>
6336
     */
6337
    public final Observable<T> onBackpressureDrop() {
6338 1 1. onBackpressureDrop : mutated return of Object value for rx/Observable::onBackpressureDrop to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorOnBackpressureDrop.<T>instance());
6339
    }
6340
    
6341
    /**
6342
     * Instructs an Observable that is emitting items faster than its observer can consume them to 
6343
     * hold onto the latest value and emit that on request.
6344
     * <p>
6345
     * <img width="640" height="245" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/bp.obp.latest.png" alt="">
6346
     * <p>
6347
     * Its behavior is logically equivalent to {@code toBlocking().latest()} with the exception that
6348
     * the downstream is not blocking while requesting more values.
6349
     * <p>
6350
     * Note that if the upstream Observable does support backpressure, this operator ignores that capability
6351
     * and doesn't propagate any backpressure requests from downstream.
6352
     * <p>
6353
     * Note that due to the nature of how backpressure requests are propagated through subscribeOn/observeOn,
6354
     * requesting more than 1 from downstream doesn't guarantee a continuous delivery of onNext events.
6355
     *
6356
     * @return the source Observable modified so that it emits the most recently-received item upon request
6357
     * @since 1.1.0
6358
     */
6359
    public final Observable<T> onBackpressureLatest() {
6360 1 1. onBackpressureLatest : mutated return of Object value for rx/Observable::onBackpressureLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorOnBackpressureLatest.<T>instance());
6361
    }
6362
    
6363
    /**
6364
     * Instructs an Observable to pass control to another Observable rather than invoking
6365
     * {@link Observer#onError onError} if it encounters an error.
6366
     * <p>
6367
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/onErrorResumeNext.png" alt="">
6368
     * <p>
6369
     * By default, when an Observable encounters an error that prevents it from emitting the expected item to
6370
     * its {@link Observer}, the Observable invokes its Observer's {@code onError} method, and then quits
6371
     * without invoking any more of its Observer's methods. The {@code onErrorResumeNext} method changes this
6372
     * behavior. If you pass a function that returns an Observable ({@code resumeFunction}) to
6373
     * {@code onErrorResumeNext}, if the original Observable encounters an error, instead of invoking its
6374
     * Observer's {@code onError} method, it will instead relinquish control to the Observable returned from
6375
     * {@code resumeFunction}, which will invoke the Observer's {@link Observer#onNext onNext} method if it is
6376
     * able to do so. In such a case, because no Observable necessarily invokes {@code onError}, the Observer
6377
     * may never know that an error happened.
6378
     * <p>
6379
     * You can use this to prevent errors from propagating or to supply fallback data should errors be
6380
     * encountered.
6381
     * <dl>
6382
     *  <dt><b>Scheduler:</b></dt>
6383
     *  <dd>{@code onErrorResumeNext} does not operate by default on a particular {@link Scheduler}.</dd>
6384
     * </dl>
6385
     * 
6386
     * @param resumeFunction
6387
     *            a function that returns an Observable that will take over if the source Observable encounters
6388
     *            an error
6389
     * @return the original Observable, with appropriately modified behavior
6390
     * @see <a href="http://reactivex.io/documentation/operators/catch.html">ReactiveX operators documentation: Catch</a>
6391
     */
6392
    public final Observable<T> onErrorResumeNext(final Func1<Throwable, ? extends Observable<? extends T>> resumeFunction) {
6393 1 1. onErrorResumeNext : mutated return of Object value for rx/Observable::onErrorResumeNext to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorOnErrorResumeNextViaFunction<T>(resumeFunction));
6394
    }
6395
6396
    /**
6397
     * Instructs an Observable to pass control to another Observable rather than invoking
6398
     * {@link Observer#onError onError} if it encounters an error.
6399
     * <p>
6400
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/onErrorResumeNext.png" alt="">
6401
     * <p>
6402
     * By default, when an Observable encounters an error that prevents it from emitting the expected item to
6403
     * its {@link Observer}, the Observable invokes its Observer's {@code onError} method, and then quits
6404
     * without invoking any more of its Observer's methods. The {@code onErrorResumeNext} method changes this
6405
     * behavior. If you pass another Observable ({@code resumeSequence}) to an Observable's
6406
     * {@code onErrorResumeNext} method, if the original Observable encounters an error, instead of invoking its
6407
     * Observer's {@code onError} method, it will instead relinquish control to {@code resumeSequence} which
6408
     * will invoke the Observer's {@link Observer#onNext onNext} method if it is able to do so. In such a case,
6409
     * because no Observable necessarily invokes {@code onError}, the Observer may never know that an error
6410
     * happened.
6411
     * <p>
6412
     * You can use this to prevent errors from propagating or to supply fallback data should errors be
6413
     * encountered.
6414
     * <dl>
6415
     *  <dt><b>Scheduler:</b></dt>
6416
     *  <dd>{@code onErrorResumeNext} does not operate by default on a particular {@link Scheduler}.</dd>
6417
     * </dl>
6418
     * 
6419
     * @param resumeSequence
6420
     *            a function that returns an Observable that will take over if the source Observable encounters
6421
     *            an error
6422
     * @return the original Observable, with appropriately modified behavior
6423
     * @see <a href="http://reactivex.io/documentation/operators/catch.html">ReactiveX operators documentation: Catch</a>
6424
     */
6425
    public final Observable<T> onErrorResumeNext(final Observable<? extends T> resumeSequence) {
6426 1 1. onErrorResumeNext : mutated return of Object value for rx/Observable::onErrorResumeNext to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorOnErrorResumeNextViaFunction.withOther(resumeSequence));
6427
    }
6428
6429
    /**
6430
     * Instructs an Observable to emit an item (returned by a specified function) rather than invoking
6431
     * {@link Observer#onError onError} if it encounters an error.
6432
     * <p>
6433
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/onErrorReturn.png" alt="">
6434
     * <p>
6435
     * By default, when an Observable encounters an error that prevents it from emitting the expected item to
6436
     * its {@link Observer}, the Observable invokes its Observer's {@code onError} method, and then quits
6437
     * without invoking any more of its Observer's methods. The {@code onErrorReturn} method changes this
6438
     * behavior. If you pass a function ({@code resumeFunction}) to an Observable's {@code onErrorReturn}
6439
     * method, if the original Observable encounters an error, instead of invoking its Observer's
6440
     * {@code onError} method, it will instead emit the return value of {@code resumeFunction}.
6441
     * <p>
6442
     * You can use this to prevent errors from propagating or to supply fallback data should errors be
6443
     * encountered.
6444
     * <dl>
6445
     *  <dt><b>Scheduler:</b></dt>
6446
     *  <dd>{@code onErrorReturn} does not operate by default on a particular {@link Scheduler}.</dd>
6447
     * </dl>
6448
     * 
6449
     * @param resumeFunction
6450
     *            a function that returns an item that the new Observable will emit if the source Observable
6451
     *            encounters an error
6452
     * @return the original Observable with appropriately modified behavior
6453
     * @see <a href="http://reactivex.io/documentation/operators/catch.html">ReactiveX operators documentation: Catch</a>
6454
     */
6455
    public final Observable<T> onErrorReturn(Func1<Throwable, ? extends T> resumeFunction) {
6456 1 1. onErrorReturn : mutated return of Object value for rx/Observable::onErrorReturn to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorOnErrorResumeNextViaFunction.withSingle(resumeFunction));
6457
    }
6458
6459
    /**
6460
     * Instructs an Observable to pass control to another Observable rather than invoking
6461
     * {@link Observer#onError onError} if it encounters an {@link java.lang.Exception}.
6462
     * <p>
6463
     * This differs from {@link #onErrorResumeNext} in that this one does not handle {@link java.lang.Throwable}
6464
     * or {@link java.lang.Error} but lets those continue through.
6465
     * <p>
6466
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/onExceptionResumeNextViaObservable.png" alt="">
6467
     * <p>
6468
     * By default, when an Observable encounters an exception that prevents it from emitting the expected item
6469
     * to its {@link Observer}, the Observable invokes its Observer's {@code onError} method, and then quits
6470
     * without invoking any more of its Observer's methods. The {@code onExceptionResumeNext} method changes
6471
     * this behavior. If you pass another Observable ({@code resumeSequence}) to an Observable's
6472
     * {@code onExceptionResumeNext} method, if the original Observable encounters an exception, instead of
6473
     * invoking its Observer's {@code onError} method, it will instead relinquish control to
6474
     * {@code resumeSequence} which will invoke the Observer's {@link Observer#onNext onNext} method if it is
6475
     * able to do so. In such a case, because no Observable necessarily invokes {@code onError}, the Observer
6476
     * may never know that an exception happened.
6477
     * <p>
6478
     * You can use this to prevent exceptions from propagating or to supply fallback data should exceptions be
6479
     * encountered.
6480
     * <dl>
6481
     *  <dt><b>Scheduler:</b></dt>
6482
     *  <dd>{@code onExceptionResumeNext} does not operate by default on a particular {@link Scheduler}.</dd>
6483
     * </dl>
6484
     * 
6485
     * @param resumeSequence
6486
     *            a function that returns an Observable that will take over if the source Observable encounters
6487
     *            an exception
6488
     * @return the original Observable, with appropriately modified behavior
6489
     * @see <a href="http://reactivex.io/documentation/operators/catch.html">ReactiveX operators documentation: Catch</a>
6490
     */
6491
    public final Observable<T> onExceptionResumeNext(final Observable<? extends T> resumeSequence) {
6492 1 1. onExceptionResumeNext : mutated return of Object value for rx/Observable::onExceptionResumeNext to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorOnErrorResumeNextViaFunction.withException(resumeSequence));
6493
    }
6494
6495
    /**
6496
     * Returns a {@link ConnectableObservable}, which is a variety of Observable that waits until its
6497
     * {@link ConnectableObservable#connect connect} method is called before it begins emitting items to those
6498
     * {@link Observer}s that have subscribed to it.
6499
     * <p>
6500
     * <img width="640" height="510" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/publishConnect.png" alt="">
6501
     * <dl>
6502
     *  <dt><b>Scheduler:</b></dt>
6503
     *  <dd>{@code publish} does not operate by default on a particular {@link Scheduler}.</dd>
6504
     * </dl>
6505
     * 
6506
     * @return a {@link ConnectableObservable} that upon connection causes the source Observable to emit items
6507
     *         to its {@link Observer}s
6508
     * @see <a href="http://reactivex.io/documentation/operators/publish.html">ReactiveX operators documentation: Publish</a>
6509
     */
6510
    public final ConnectableObservable<T> publish() {
6511 1 1. publish : mutated return of Object value for rx/Observable::publish to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorPublish.create(this);
6512
    }
6513
6514
    /**
6515
     * Returns an Observable that emits the results of invoking a specified selector on items emitted by a
6516
     * {@link ConnectableObservable} that shares a single subscription to the underlying sequence.
6517
     * <p>
6518
     * <img width="640" height="510" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/publishConnect.f.png" alt="">
6519
     * <dl>
6520
     *  <dt><b>Scheduler:</b></dt>
6521
     *  <dd>{@code publish} does not operate by default on a particular {@link Scheduler}.</dd>
6522
     * </dl>
6523
     * 
6524
     * @param <R>
6525
     *            the type of items emitted by the resulting Observable
6526
     * @param selector
6527
     *            a function that can use the multicasted source sequence as many times as needed, without
6528
     *            causing multiple subscriptions to the source sequence. Subscribers to the given source will
6529
     *            receive all notifications of the source from the time of the subscription forward.
6530
     * @return an Observable that emits the results of invoking the selector on the items emitted by a {@link ConnectableObservable} that shares a single subscription to the underlying sequence
6531
     * @see <a href="http://reactivex.io/documentation/operators/publish.html">ReactiveX operators documentation: Publish</a>
6532
     */
6533
    public final <R> Observable<R> publish(Func1<? super Observable<T>, ? extends Observable<R>> selector) {
6534 1 1. publish : mutated return of Object value for rx/Observable::publish to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorPublish.create(this, selector);
6535
    }
6536
6537
    /**
6538
     * Returns an Observable that applies a specified accumulator function to the first item emitted by a source
6539
     * Observable, then feeds the result of that function along with the second item emitted by the source
6540
     * Observable into the same function, and so on until all items have been emitted by the source Observable,
6541
     * and emits the final result from the final call to your function as its sole item.
6542
     * <p>
6543
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/reduce.png" alt="">
6544
     * <p>
6545
     * This technique, which is called "reduce" here, is sometimes called "aggregate," "fold," "accumulate,"
6546
     * "compress," or "inject" in other programming contexts. Groovy, for instance, has an {@code inject} method
6547
     * that does a similar operation on lists.
6548
     * <dl>
6549
     *  <dt><b>Backpressure Support:</b></dt>
6550
     *  <dd>This operator does not support backpressure because by intent it will receive all values and reduce
6551
     *      them to a single {@code onNext}.</dd>
6552
     *  <dt><b>Scheduler:</b></dt>
6553
     *  <dd>{@code reduce} does not operate by default on a particular {@link Scheduler}.</dd>
6554
     * </dl>
6555
     * 
6556
     * @param accumulator
6557
     *            an accumulator function to be invoked on each item emitted by the source Observable, whose
6558
     *            result will be used in the next accumulator call
6559
     * @return an Observable that emits a single item that is the result of accumulating the items emitted by
6560
     *         the source Observable
6561
     * @throws IllegalArgumentException
6562
     *             if the source Observable emits no items
6563
     * @see <a href="http://reactivex.io/documentation/operators/reduce.html">ReactiveX operators documentation: Reduce</a>
6564
     * @see <a href="http://en.wikipedia.org/wiki/Fold_(higher-order_function)">Wikipedia: Fold (higher-order function)</a>
6565
     */
6566
    public final Observable<T> reduce(Func2<T, T, T> accumulator) {
6567
        /*
6568
         * Discussion and confirmation of implementation at
6569
         * https://github.com/ReactiveX/RxJava/issues/423#issuecomment-27642532
6570
         * 
6571
         * It should use last() not takeLast(1) since it needs to emit an error if the sequence is empty.
6572
         */
6573 1 1. reduce : mutated return of Object value for rx/Observable::reduce to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return scan(accumulator).last();
6574
    }
6575
6576
    /**
6577
     * Returns an Observable that applies a specified accumulator function to the first item emitted by a source
6578
     * Observable and a specified seed value, then feeds the result of that function along with the second item
6579
     * emitted by an Observable into the same function, and so on until all items have been emitted by the
6580
     * source Observable, emitting the final result from the final call to your function as its sole item.
6581
     * <p>
6582
     * <img width="640" height="325" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/reduceSeed.png" alt="">
6583
     * <p>
6584
     * This technique, which is called "reduce" here, is sometimec called "aggregate," "fold," "accumulate,"
6585
     * "compress," or "inject" in other programming contexts. Groovy, for instance, has an {@code inject} method
6586
     * that does a similar operation on lists.
6587
     * <dl>
6588
     *  <dt><b>Backpressure Support:</b></dt>
6589
     *  <dd>This operator does not support backpressure because by intent it will receive all values and reduce
6590
     *      them to a single {@code onNext}.</dd>
6591
     *  <dt><b>Scheduler:</b></dt>
6592
     *  <dd>{@code reduce} does not operate by default on a particular {@link Scheduler}.</dd>
6593
     * </dl>
6594
     * 
6595
     * @param initialValue
6596
     *            the initial (seed) accumulator value
6597
     * @param accumulator
6598
     *            an accumulator function to be invoked on each item emitted by the source Observable, the
6599
     *            result of which will be used in the next accumulator call
6600
     * @return an Observable that emits a single item that is the result of accumulating the output from the
6601
     *         items emitted by the source Observable
6602
     * @see <a href="http://reactivex.io/documentation/operators/reduce.html">ReactiveX operators documentation: Reduce</a>
6603
     * @see <a href="http://en.wikipedia.org/wiki/Fold_(higher-order_function)">Wikipedia: Fold (higher-order function)</a>
6604
     */
6605
    public final <R> Observable<R> reduce(R initialValue, Func2<R, ? super T, R> accumulator) {
6606 1 1. reduce : mutated return of Object value for rx/Observable::reduce to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return scan(initialValue, accumulator).takeLast(1);
6607
    }
6608
    
6609
    /**
6610
     * Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely.
6611
     * <p>
6612
     * <img width="640" height="309" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/repeat.o.png" alt="">
6613
     * <dl>
6614
     *  <dt><b>Scheduler:</b></dt>
6615
     *  <dd>{@code repeat} operates by default on the {@code trampoline} {@link Scheduler}.</dd>
6616
     * </dl>
6617
     * 
6618
     * @return an Observable that emits the items emitted by the source Observable repeatedly and in sequence
6619
     * @see <a href="http://reactivex.io/documentation/operators/repeat.html">ReactiveX operators documentation: Repeat</a>
6620
     */
6621
    public final Observable<T> repeat() {
6622 1 1. repeat : mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OnSubscribeRedo.<T>repeat(this);
6623
    }
6624
6625
    /**
6626
     * Returns an Observable that repeats the sequence of items emitted by the source Observable indefinitely,
6627
     * on a particular Scheduler.
6628
     * <p>
6629
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/repeat.os.png" alt="">
6630
     * <dl>
6631
     *  <dt><b>Scheduler:</b></dt>
6632
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
6633
     * </dl>
6634
     * 
6635
     * @param scheduler
6636
     *            the Scheduler to emit the items on
6637
     * @return an Observable that emits the items emitted by the source Observable repeatedly and in sequence
6638
     * @see <a href="http://reactivex.io/documentation/operators/repeat.html">ReactiveX operators documentation: Repeat</a>
6639
     */
6640
    public final Observable<T> repeat(Scheduler scheduler) {
6641 1 1. repeat : mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OnSubscribeRedo.<T>repeat(this, scheduler);
6642
    }
6643
6644
    /**
6645
     * Returns an Observable that repeats the sequence of items emitted by the source Observable at most
6646
     * {@code count} times.
6647
     * <p>
6648
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/repeat.on.png" alt="">
6649
     * <dl>
6650
     *  <dt><b>Scheduler:</b></dt>
6651
     *  <dd>{@code repeat} operates by default on the {@code trampoline} {@link Scheduler}.</dd>
6652
     * </dl>
6653
     * 
6654
     * @param count
6655
     *            the number of times the source Observable items are repeated, a count of 0 will yield an empty
6656
     *            sequence
6657
     * @return an Observable that repeats the sequence of items emitted by the source Observable at most
6658
     *         {@code count} times
6659
     * @throws IllegalArgumentException
6660
     *             if {@code count} is less than zero
6661
     * @see <a href="http://reactivex.io/documentation/operators/repeat.html">ReactiveX operators documentation: Repeat</a>
6662
     */
6663
    public final Observable<T> repeat(final long count) {
6664 1 1. repeat : mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OnSubscribeRedo.<T>repeat(this, count);
6665
    }
6666
6667
    /**
6668
     * Returns an Observable that repeats the sequence of items emitted by the source Observable at most
6669
     * {@code count} times, on a particular Scheduler.
6670
     * <p>
6671
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/repeat.ons.png" alt="">
6672
     * <dl>
6673
     *  <dt><b>Scheduler:</b></dt>
6674
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
6675
     * </dl>
6676
     * 
6677
     * @param count
6678
     *            the number of times the source Observable items are repeated, a count of 0 will yield an empty
6679
     *            sequence
6680
     * @param scheduler
6681
     *            the {@link Scheduler} to emit the items on
6682
     * @return an Observable that repeats the sequence of items emitted by the source Observable at most
6683
     *         {@code count} times on a particular Scheduler
6684
     * @see <a href="http://reactivex.io/documentation/operators/repeat.html">ReactiveX operators documentation: Repeat</a>
6685
     */
6686
    public final Observable<T> repeat(final long count, Scheduler scheduler) {
6687 1 1. repeat : mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OnSubscribeRedo.<T>repeat(this, count, scheduler);
6688
    }
6689
6690
    /**
6691
     * Returns an Observable that emits the same values as the source Observable with the exception of an
6692
     * {@code onCompleted}. An {@code onCompleted} notification from the source will result in the emission of
6693
     * a {@code void} item to the Observable provided as an argument to the {@code notificationHandler}
6694
     * function. If that Observable calls {@code onComplete} or {@code onError} then {@code repeatWhen} will
6695
     * call {@code onCompleted} or {@code onError} on the child subscription. Otherwise, this Observable will
6696
     * resubscribe to the source Observable, on a particular Scheduler.
6697
     * <p>
6698
     * <img width="640" height="430" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/repeatWhen.f.png" alt="">
6699
     * <dl>
6700
     *  <dt><b>Scheduler:</b></dt>
6701
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
6702
     * </dl>
6703
     * 
6704
     * @param notificationHandler
6705
     *            receives an Observable of notifications with which a user can complete or error, aborting the repeat.
6706
     * @param scheduler
6707
     *            the {@link Scheduler} to emit the items on
6708
     * @return the source Observable modified with repeat logic
6709
     * @see <a href="http://reactivex.io/documentation/operators/repeat.html">ReactiveX operators documentation: Repeat</a>
6710
     */
6711
    public final Observable<T> repeatWhen(final Func1<? super Observable<? extends Void>, ? extends Observable<?>> notificationHandler, Scheduler scheduler) {
6712
        Func1<? super Observable<? extends Notification<?>>, ? extends Observable<?>> dematerializedNotificationHandler = new Func1<Observable<? extends Notification<?>>, Observable<?>>() {
6713
            @Override
6714
            public Observable<?> call(Observable<? extends Notification<?>> notifications) {
6715 1 1. call : mutated return of Object value for rx/Observable$14::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return notificationHandler.call(notifications.map(new Func1<Notification<?>, Void>() {
6716
                    @Override
6717
                    public Void call(Notification<?> notification) {
6718 1 1. call : mutated return of Object value for rx/Observable$14$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                        return null;
6719
                    }
6720
                }));
6721
            }
6722
        };
6723 1 1. repeatWhen : mutated return of Object value for rx/Observable::repeatWhen to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OnSubscribeRedo.repeat(this, dematerializedNotificationHandler, scheduler);
6724
    }
6725
6726
    /**
6727
     * Returns an Observable that emits the same values as the source Observable with the exception of an
6728
     * {@code onCompleted}. An {@code onCompleted} notification from the source will result in the emission of
6729
     * a {@code void} item to the Observable provided as an argument to the {@code notificationHandler}
6730
     * function. If that Observable calls {@code onComplete} or {@code onError} then {@code repeatWhen} will
6731
     * call {@code onCompleted} or {@code onError} on the child subscription. Otherwise, this Observable will
6732
     * resubscribe to the source observable.
6733
     * <p>
6734
     * <img width="640" height="430" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/repeatWhen.f.png" alt="">
6735
     * <dl>
6736
     *  <dt><b>Scheduler:</b></dt>
6737
     *  <dd>{@code repeatWhen} operates by default on the {@code trampoline} {@link Scheduler}.</dd>
6738
     * </dl>
6739
     * 
6740
     * @param notificationHandler
6741
     *            receives an Observable of notifications with which a user can complete or error, aborting the repeat.
6742
     * @return the source Observable modified with repeat logic
6743
     * @see <a href="http://reactivex.io/documentation/operators/repeat.html">ReactiveX operators documentation: Repeat</a>
6744
     */
6745
    public final Observable<T> repeatWhen(final Func1<? super Observable<? extends Void>, ? extends Observable<?>> notificationHandler) {
6746
        Func1<? super Observable<? extends Notification<?>>, ? extends Observable<?>> dematerializedNotificationHandler = new Func1<Observable<? extends Notification<?>>, Observable<?>>() {
6747
            @Override
6748
            public Observable<?> call(Observable<? extends Notification<?>> notifications) {
6749 1 1. call : mutated return of Object value for rx/Observable$15::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return notificationHandler.call(notifications.map(new Func1<Notification<?>, Void>() {
6750
                    @Override
6751
                    public Void call(Notification<?> notification) {
6752 1 1. call : mutated return of Object value for rx/Observable$15$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                        return null;
6753
                    }
6754
                }));
6755
            }
6756
        };
6757 1 1. repeatWhen : mutated return of Object value for rx/Observable::repeatWhen to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OnSubscribeRedo.repeat(this, dematerializedNotificationHandler);
6758
    }
6759
6760
    /**
6761
     * Returns a {@link ConnectableObservable} that shares a single subscription to the underlying Observable
6762
     * that will replay all of its items and notifications to any future {@link Observer}. A Connectable
6763
     * Observable resembles an ordinary Observable, except that it does not begin emitting items when it is
6764
     * subscribed to, but only when its {@code connect} method is called.
6765
     * <p>
6766
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.png" alt="">
6767
     * <dl>
6768
     *  <dt><b>Backpressure Support:</b></dt>
6769
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
6770
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
6771
     *  request 100 elements from the underlying Observable sequence.</dd>
6772
     *  <dt><b>Scheduler:</b></dt>
6773
     *  <dd>This version of {@code replay} does not operate by default on a particular {@link Scheduler}.</dd>
6774
     * </dl>
6775
     * 
6776
     * @return a {@link ConnectableObservable} that upon connection causes the source Observable to emit its
6777
     *         items to its {@link Observer}s
6778
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
6779
     */
6780
    public final ConnectableObservable<T> replay() {
6781 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorReplay.create(this);
6782
    }
6783
6784
    /**
6785
     * Returns an Observable that emits items that are the results of invoking a specified selector on the items
6786
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable.
6787
     * <p>
6788
     * <img width="640" height="450" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.f.png" alt="">
6789
     * <dl>
6790
     *  <dt><b>Backpressure Support:</b></dt>
6791
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
6792
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
6793
     *  request 100 elements from the underlying Observable sequence.</dd>
6794
     *  <dt><b>Scheduler:</b></dt>
6795
     *  <dd>This version of {@code replay} does not operate by default on a particular {@link Scheduler}.</dd>
6796
     * </dl>
6797
     * 
6798
     * @param <R>
6799
     *            the type of items emitted by the resulting Observable
6800
     * @param selector
6801
     *            the selector function, which can use the multicasted sequence as many times as needed, without
6802
     *            causing multiple subscriptions to the Observable
6803
     * @return an Observable that emits items that are the results of invoking the selector on a
6804
     *         {@link ConnectableObservable} that shares a single subscription to the source Observable
6805
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
6806
     */
6807
    public final <R> Observable<R> replay(Func1<? super Observable<T>, ? extends Observable<R>> selector) {
6808 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorReplay.multicastSelector(new Func0<ConnectableObservable<T>>() {
6809
            @Override
6810
            public ConnectableObservable<T> call() {
6811 1 1. call : mutated return of Object value for rx/Observable$16::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return Observable.this.replay();
6812
            }
6813
        }, selector);
6814
    }
6815
6816
    /**
6817
     * Returns an Observable that emits items that are the results of invoking a specified selector on items
6818
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable,
6819
     * replaying {@code bufferSize} notifications.
6820
     * <p>
6821
     * <img width="640" height="440" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.fn.png" alt="">
6822
     * <dl>
6823
     *  <dt><b>Backpressure Support:</b></dt>
6824
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
6825
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
6826
     *  request 100 elements from the underlying Observable sequence.</dd>
6827
     *  <dt><b>Scheduler:</b></dt>
6828
     *  <dd>This version of {@code replay} does not operate by default on a particular {@link Scheduler}.</dd>
6829
     * </dl>
6830
     * 
6831
     * @param <R>
6832
     *            the type of items emitted by the resulting Observable
6833
     * @param selector
6834
     *            the selector function, which can use the multicasted sequence as many times as needed, without
6835
     *            causing multiple subscriptions to the Observable
6836
     * @param bufferSize
6837
     *            the buffer size that limits the number of items the connectable observable can replay
6838
     * @return an Observable that emits items that are the results of invoking the selector on items emitted by
6839
     *         a {@link ConnectableObservable} that shares a single subscription to the source Observable
6840
     *         replaying no more than {@code bufferSize} items
6841
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
6842
     */
6843
    public final <R> Observable<R> replay(Func1<? super Observable<T>, ? extends Observable<R>> selector, final int bufferSize) {
6844 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorReplay.multicastSelector(new Func0<ConnectableObservable<T>>() {
6845
            @Override
6846
            public ConnectableObservable<T> call() {
6847 1 1. call : mutated return of Object value for rx/Observable$17::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return Observable.this.replay(bufferSize);
6848
            }
6849
        }, selector);
6850
    }
6851
6852
    /**
6853
     * Returns an Observable that emits items that are the results of invoking a specified selector on items
6854
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable,
6855
     * replaying no more than {@code bufferSize} items that were emitted within a specified time window.
6856
     * <p>
6857
     * <img width="640" height="445" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.fnt.png" alt="">
6858
     * <dl>
6859
     *  <dt><b>Backpressure Support:</b></dt>
6860
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
6861
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
6862
     *  request 100 elements from the underlying Observable sequence.</dd>
6863
     *  <dt><b>Scheduler:</b></dt>
6864
     *  <dd>This version of {@code replay} operates by default on the {@code computation} {@link Scheduler}.</dd>
6865
     * </dl>
6866
     * 
6867
     * @param <R>
6868
     *            the type of items emitted by the resulting Observable
6869
     * @param selector
6870
     *            a selector function, which can use the multicasted sequence as many times as needed, without
6871
     *            causing multiple subscriptions to the Observable
6872
     * @param bufferSize
6873
     *            the buffer size that limits the number of items the connectable observable can replay
6874
     * @param time
6875
     *            the duration of the window in which the replayed items must have been emitted
6876
     * @param unit
6877
     *            the time unit of {@code time}
6878
     * @return an Observable that emits items that are the results of invoking the selector on items emitted by
6879
     *         a {@link ConnectableObservable} that shares a single subscription to the source Observable, and
6880
     *         replays no more than {@code bufferSize} items that were emitted within the window defined by
6881
     *         {@code time}
6882
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
6883
     */
6884
    public final <R> Observable<R> replay(Func1<? super Observable<T>, ? extends Observable<R>> selector, int bufferSize, long time, TimeUnit unit) {
6885 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return replay(selector, bufferSize, time, unit, Schedulers.computation());
6886
    }
6887
6888
    /**
6889
     * Returns an Observable that emits items that are the results of invoking a specified selector on items
6890
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable,
6891
     * replaying no more than {@code bufferSize} items that were emitted within a specified time window.
6892
     * <p>
6893
     * <img width="640" height="445" height="440" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.fnts.png" alt="">
6894
     * <dl>
6895
     *  <dt><b>Backpressure Support:</b></dt>
6896
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
6897
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
6898
     *  request 100 elements from the underlying Observable sequence.</dd>
6899
     *  <dt><b>Scheduler:</b></dt>
6900
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
6901
     * </dl>
6902
     * 
6903
     * @param <R>
6904
     *            the type of items emitted by the resulting Observable
6905
     * @param selector
6906
     *            a selector function, which can use the multicasted sequence as many times as needed, without
6907
     *            causing multiple subscriptions to the Observable
6908
     * @param bufferSize
6909
     *            the buffer size that limits the number of items the connectable observable can replay
6910
     * @param time
6911
     *            the duration of the window in which the replayed items must have been emitted
6912
     * @param unit
6913
     *            the time unit of {@code time}
6914
     * @param scheduler
6915
     *            the Scheduler that is the time source for the window
6916
     * @return an Observable that emits items that are the results of invoking the selector on items emitted by
6917
     *         a {@link ConnectableObservable} that shares a single subscription to the source Observable, and
6918
     *         replays no more than {@code bufferSize} items that were emitted within the window defined by
6919
     *         {@code time}
6920
     * @throws IllegalArgumentException
6921
     *             if {@code bufferSize} is less than zero
6922
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
6923
     */
6924
    public final <R> Observable<R> replay(Func1<? super Observable<T>, ? extends Observable<R>> selector, final int bufferSize, final long time, final TimeUnit unit, final Scheduler scheduler) {
6925 2 1. replay : changed conditional boundary → NO_COVERAGE
2. replay : negated conditional → NO_COVERAGE
        if (bufferSize < 0) {
6926
            throw new IllegalArgumentException("bufferSize < 0");
6927
        }
6928 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OperatorReplay.multicastSelector(new Func0<ConnectableObservable<T>>() {
6929
            @Override
6930
            public ConnectableObservable<T> call() {
6931 1 1. call : mutated return of Object value for rx/Observable$18::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return Observable.this.replay(bufferSize, time, unit, scheduler);
6932
            }
6933
        }, selector);
6934
    }
6935
6936
    /**
6937
     * Returns an Observable that emits items that are the results of invoking a specified selector on items
6938
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable,
6939
     * replaying a maximum of {@code bufferSize} items.
6940
     * <p>
6941
     * <img width="640" height="440" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.fns.png" alt="">
6942
     * <dl>
6943
     *  <dt><b>Backpressure Support:</b></dt>
6944
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
6945
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
6946
     *  request 100 elements from the underlying Observable sequence.</dd>
6947
     *  <dt><b>Scheduler:</b></dt>
6948
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
6949
     * </dl>
6950
     * 
6951
     * @param <R>
6952
     *            the type of items emitted by the resulting Observable
6953
     * @param selector
6954
     *            a selector function, which can use the multicasted sequence as many times as needed, without
6955
     *            causing multiple subscriptions to the Observable
6956
     * @param bufferSize
6957
     *            the buffer size that limits the number of items the connectable observable can replay
6958
     * @param scheduler
6959
     *            the Scheduler on which the replay is observed
6960
     * @return an Observable that emits items that are the results of invoking the selector on items emitted by
6961
     *         a {@link ConnectableObservable} that shares a single subscription to the source Observable,
6962
     *         replaying no more than {@code bufferSize} notifications
6963
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
6964
     */
6965
    public final <R> Observable<R> replay(final Func1<? super Observable<T>, ? extends Observable<R>> selector, final int bufferSize, final Scheduler scheduler) {
6966 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OperatorReplay.multicastSelector(new Func0<ConnectableObservable<T>>() {
6967
            @Override
6968
            public ConnectableObservable<T> call() {
6969 1 1. call : mutated return of Object value for rx/Observable$19::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return Observable.this.replay(bufferSize);
6970
            }
6971
        }, new Func1<Observable<T>, Observable<R>>() {
6972
            @Override
6973
            public Observable<R> call(Observable<T> t) {
6974 1 1. call : mutated return of Object value for rx/Observable$20::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return selector.call(t).observeOn(scheduler);
6975
            }
6976
        });
6977
    }
6978
6979
    /**
6980
     * Returns an Observable that emits items that are the results of invoking a specified selector on items
6981
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable,
6982
     * replaying all items that were emitted within a specified time window.
6983
     * <p>
6984
     * <img width="640" height="435" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.ft.png" alt="">
6985
     * <dl>
6986
     *  <dt><b>Backpressure Support:</b></dt>
6987
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
6988
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
6989
     *  request 100 elements from the underlying Observable sequence.</dd>
6990
     *  <dt><b>Scheduler:</b></dt>
6991
     *  <dd>This version of {@code replay} operates by default on the {@code computation} {@link Scheduler}.</dd>
6992
     * </dl>
6993
     * 
6994
     * @param <R>
6995
     *            the type of items emitted by the resulting Observable
6996
     * @param selector
6997
     *            a selector function, which can use the multicasted sequence as many times as needed, without
6998
     *            causing multiple subscriptions to the Observable
6999
     * @param time
7000
     *            the duration of the window in which the replayed items must have been emitted
7001
     * @param unit
7002
     *            the time unit of {@code time}
7003
     * @return an Observable that emits items that are the results of invoking the selector on items emitted by
7004
     *         a {@link ConnectableObservable} that shares a single subscription to the source Observable,
7005
     *         replaying all items that were emitted within the window defined by {@code time}
7006
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7007
     */
7008
    public final <R> Observable<R> replay(Func1<? super Observable<T>, ? extends Observable<R>> selector, long time, TimeUnit unit) {
7009 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return replay(selector, time, unit, Schedulers.computation());
7010
    }
7011
7012
    /**
7013
     * Returns an Observable that emits items that are the results of invoking a specified selector on items
7014
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable,
7015
     * replaying all items that were emitted within a specified time window.
7016
     * <p>
7017
     * <img width="640" height="440" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.fts.png" alt="">
7018
     * <dl>
7019
     *  <dt><b>Backpressure Support:</b></dt>
7020
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7021
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7022
     *  request 100 elements from the underlying Observable sequence.</dd>
7023
     *  <dt><b>Scheduler:</b></dt>
7024
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7025
     * </dl>
7026
     * 
7027
     * @param <R>
7028
     *            the type of items emitted by the resulting Observable
7029
     * @param selector
7030
     *            a selector function, which can use the multicasted sequence as many times as needed, without
7031
     *            causing multiple subscriptions to the Observable
7032
     * @param time
7033
     *            the duration of the window in which the replayed items must have been emitted
7034
     * @param unit
7035
     *            the time unit of {@code time}
7036
     * @param scheduler
7037
     *            the scheduler that is the time source for the window
7038
     * @return an Observable that emits items that are the results of invoking the selector on items emitted by
7039
     *         a {@link ConnectableObservable} that shares a single subscription to the source Observable,
7040
     *         replaying all items that were emitted within the window defined by {@code time}
7041
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7042
     */
7043
    public final <R> Observable<R> replay(Func1<? super Observable<T>, ? extends Observable<R>> selector, final long time, final TimeUnit unit, final Scheduler scheduler) {
7044 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorReplay.multicastSelector(new Func0<ConnectableObservable<T>>() {
7045
            @Override
7046
            public ConnectableObservable<T> call() {
7047 1 1. call : mutated return of Object value for rx/Observable$21::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return Observable.this.replay(time, unit, scheduler);
7048
            }
7049
        }, selector);
7050
    }
7051
7052
    /**
7053
     * Returns an Observable that emits items that are the results of invoking a specified selector on items
7054
     * emitted by a {@link ConnectableObservable} that shares a single subscription to the source Observable.
7055
     * <p>
7056
     * <img width="640" height="445" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.fs.png" alt="">
7057
     * <dl>
7058
     *  <dt><b>Backpressure Support:</b></dt>
7059
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7060
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7061
     *  request 100 elements from the underlying Observable sequence.</dd>
7062
     *  <dt><b>Scheduler:</b></dt>
7063
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7064
     * </dl>
7065
     * 
7066
     * @param <R>
7067
     *            the type of items emitted by the resulting Observable
7068
     * @param selector
7069
     *            a selector function, which can use the multicasted sequence as many times as needed, without
7070
     *            causing multiple subscriptions to the Observable
7071
     * @param scheduler
7072
     *            the Scheduler where the replay is observed
7073
     * @return an Observable that emits items that are the results of invoking the selector on items emitted by
7074
     *         a {@link ConnectableObservable} that shares a single subscription to the source Observable,
7075
     *         replaying all items
7076
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7077
     */
7078
    public final <R> Observable<R> replay(final Func1<? super Observable<T>, ? extends Observable<R>> selector, final Scheduler scheduler) {
7079 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OperatorReplay.multicastSelector(new Func0<ConnectableObservable<T>>() {
7080
            @Override
7081
            public ConnectableObservable<T> call() {
7082 1 1. call : mutated return of Object value for rx/Observable$22::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return Observable.this.replay();
7083
            }
7084
        }, new Func1<Observable<T>, Observable<R>>() {
7085
            @Override
7086
            public Observable<R> call(Observable<T> t) {
7087 1 1. call : mutated return of Object value for rx/Observable$23::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return selector.call(t).observeOn(scheduler);
7088
            }
7089
        });
7090
    }
7091
7092
    /**
7093
     * Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable that
7094
     * replays at most {@code bufferSize} items emitted by that Observable. A Connectable Observable resembles
7095
     * an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only
7096
     * when its {@code connect} method is called.
7097
     * <p>
7098
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.n.png" alt="">
7099
     * <dl>
7100
     *  <dt><b>Backpressure Support:</b></dt>
7101
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7102
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7103
     *  request 100 elements from the underlying Observable sequence.</dd>
7104
     *  <dt><b>Scheduler:</b></dt>
7105
     *  <dd>This version of {@code replay} does not operate by default on a particular {@link Scheduler}.</dd>
7106
     * </dl>
7107
     * 
7108
     * @param bufferSize
7109
     *            the buffer size that limits the number of items that can be replayed
7110
     * @return a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7111
     *         replays at most {@code bufferSize} items emitted by that Observable
7112
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7113
     */
7114
    public final ConnectableObservable<T> replay(final int bufferSize) {
7115 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorReplay.create(this, bufferSize);
7116
    }
7117
7118
    /**
7119
     * Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7120
     * replays at most {@code bufferSize} items that were emitted during a specified time window. A Connectable
7121
     * Observable resembles an ordinary Observable, except that it does not begin emitting items when it is
7122
     * subscribed to, but only when its {@code connect} method is called. 
7123
     * <p>
7124
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.nt.png" alt="">
7125
     * <dl>
7126
     *  <dt><b>Backpressure Support:</b></dt>
7127
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7128
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7129
     *  request 100 elements from the underlying Observable sequence.</dd>
7130
     *  <dt><b>Scheduler:</b></dt>
7131
     *  <dd>This version of {@code replay} operates by default on the {@code computation} {@link Scheduler}.</dd>
7132
     * </dl>
7133
     * 
7134
     * @param bufferSize
7135
     *            the buffer size that limits the number of items that can be replayed
7136
     * @param time
7137
     *            the duration of the window in which the replayed items must have been emitted
7138
     * @param unit
7139
     *            the time unit of {@code time}
7140
     * @return a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7141
     *         replays at most {@code bufferSize} items that were emitted during the window defined by
7142
     *         {@code time}
7143
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7144
     */
7145
    public final ConnectableObservable<T> replay(int bufferSize, long time, TimeUnit unit) {
7146 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return replay(bufferSize, time, unit, Schedulers.computation());
7147
    }
7148
7149
    /**
7150
     * Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7151
     * that replays a maximum of {@code bufferSize} items that are emitted within a specified time window. A
7152
     * Connectable Observable resembles an ordinary Observable, except that it does not begin emitting items
7153
     * when it is subscribed to, but only when its {@code connect} method is called.
7154
     * <p>
7155
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.nts.png" alt="">
7156
     * <dl>
7157
     *  <dt><b>Backpressure Support:</b></dt>
7158
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7159
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7160
     *  request 100 elements from the underlying Observable sequence.</dd>
7161
     *  <dt><b>Scheduler:</b></dt>
7162
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7163
     * </dl>
7164
     * 
7165
     * @param bufferSize
7166
     *            the buffer size that limits the number of items that can be replayed
7167
     * @param time
7168
     *            the duration of the window in which the replayed items must have been emitted
7169
     * @param unit
7170
     *            the time unit of {@code time}
7171
     * @param scheduler
7172
     *            the scheduler that is used as a time source for the window
7173
     * @return a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7174
     *         replays at most {@code bufferSize} items that were emitted during the window defined by
7175
     *         {@code time}
7176
     * @throws IllegalArgumentException
7177
     *             if {@code bufferSize} is less than zero
7178
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7179
     */
7180
    public final ConnectableObservable<T> replay(final int bufferSize, final long time, final TimeUnit unit, final Scheduler scheduler) {
7181 2 1. replay : changed conditional boundary → SURVIVED
2. replay : negated conditional → KILLED
        if (bufferSize < 0) {
7182
            throw new IllegalArgumentException("bufferSize < 0");
7183
        }
7184 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorReplay.create(this, time, unit, scheduler, bufferSize);
7185
    }
7186
7187
    /**
7188
     * Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7189
     * replays at most {@code bufferSize} items emitted by that Observable. A Connectable Observable resembles
7190
     * an ordinary Observable, except that it does not begin emitting items when it is subscribed to, but only
7191
     * when its {@code connect} method is called. 
7192
     * <p>
7193
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.ns.png" alt="">
7194
     * <dl>
7195
     *  <dt><b>Backpressure Support:</b></dt>
7196
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7197
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7198
     *  request 100 elements from the underlying Observable sequence.</dd>
7199
     *  <dt><b>Scheduler:</b></dt>
7200
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7201
     * </dl>
7202
     * 
7203
     * @param bufferSize
7204
     *            the buffer size that limits the number of items that can be replayed
7205
     * @param scheduler
7206
     *            the scheduler on which the Observers will observe the emitted items
7207
     * @return a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7208
     *         replays at most {@code bufferSize} items that were emitted by the Observable
7209
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7210
     */
7211
    public final ConnectableObservable<T> replay(final int bufferSize, final Scheduler scheduler) {
7212 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OperatorReplay.observeOn(replay(bufferSize), scheduler);
7213
    }
7214
7215
    /**
7216
     * Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7217
     * replays all items emitted by that Observable within a specified time window. A Connectable Observable
7218
     * resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to,
7219
     * but only when its {@code connect} method is called. 
7220
     * <p>
7221
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.t.png" alt="">
7222
     * <dl>
7223
     *  <dt><b>Backpressure Support:</b></dt>
7224
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7225
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7226
     *  request 100 elements from the underlying Observable sequence.</dd>
7227
     *  <dt><b>Scheduler:</b></dt>
7228
     *  <dd>This version of {@code replay} operates by default on the {@code computation} {@link Scheduler}.</dd>
7229
     * </dl>
7230
     * 
7231
     * @param time
7232
     *            the duration of the window in which the replayed items must have been emitted
7233
     * @param unit
7234
     *            the time unit of {@code time}
7235
     * @return a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7236
     *         replays the items that were emitted during the window defined by {@code time}
7237
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7238
     */
7239
    public final ConnectableObservable<T> replay(long time, TimeUnit unit) {
7240 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return replay(time, unit, Schedulers.computation());
7241
    }
7242
7243
    /**
7244
     * Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7245
     * replays all items emitted by that Observable within a specified time window. A Connectable Observable
7246
     * resembles an ordinary Observable, except that it does not begin emitting items when it is subscribed to,
7247
     * but only when its {@code connect} method is called. 
7248
     * <p>
7249
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.ts.png" alt="">
7250
     * <dl>
7251
     *  <dt><b>Backpressure Support:</b></dt>
7252
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7253
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7254
     *  request 100 elements from the underlying Observable sequence.</dd>
7255
     *  <dt><b>Scheduler:</b></dt>
7256
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7257
     * </dl>
7258
     * 
7259
     * @param time
7260
     *            the duration of the window in which the replayed items must have been emitted
7261
     * @param unit
7262
     *            the time unit of {@code time}
7263
     * @param scheduler
7264
     *            the Scheduler that is the time source for the window
7265
     * @return a {@link ConnectableObservable} that shares a single subscription to the source Observable and
7266
     *         replays the items that were emitted during the window defined by {@code time}
7267
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7268
     */
7269
    public final ConnectableObservable<T> replay(final long time, final TimeUnit unit, final Scheduler scheduler) {
7270 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OperatorReplay.create(this, time, unit, scheduler);
7271
    }
7272
7273
    /**
7274
     * Returns a {@link ConnectableObservable} that shares a single subscription to the source Observable that
7275
     * will replay all of its items and notifications to any future {@link Observer} on the given
7276
     * {@link Scheduler}. A Connectable Observable resembles an ordinary Observable, except that it does not
7277
     * begin emitting items when it is subscribed to, but only when its {@code connect} method is called.
7278
     * <p>
7279
     * <img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/replay.s.png" alt="">
7280
     * <dl>
7281
     *  <dt><b>Backpressure Support:</b></dt>
7282
     *  <dd>This operator supports backpressure. Note that the upstream requests are determined by the child
7283
     *  Subscriber which requests the largest amount: i.e., two child Subscribers with requests of 10 and 100 will
7284
     *  request 100 elements from the underlying Observable sequence.</dd>
7285
     *  <dt><b>Scheduler:</b></dt>
7286
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7287
     * </dl>
7288
     * 
7289
     * @param scheduler
7290
     *            the Scheduler on which the Observers will observe the emitted items
7291
     * @return a {@link ConnectableObservable} that shares a single subscription to the source Observable that
7292
     *         will replay all of its items and notifications to any future {@link Observer} on the given
7293
     *         {@link Scheduler}
7294
     * @see <a href="http://reactivex.io/documentation/operators/replay.html">ReactiveX operators documentation: Replay</a>
7295
     */
7296
    public final ConnectableObservable<T> replay(final Scheduler scheduler) {
7297 1 1. replay : mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OperatorReplay.observeOn(replay(), scheduler);
7298
    }
7299
7300
    /**
7301
     * Returns an Observable that mirrors the source Observable, resubscribing to it if it calls {@code onError}
7302
     * (infinite retry count).
7303
     * <p>
7304
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/retry.png" alt="">
7305
     * <p>
7306
     * If the source Observable calls {@link Observer#onError}, this method will resubscribe to the source
7307
     * Observable rather than propagating the {@code onError} call.
7308
     * <p>
7309
     * Any and all items emitted by the source Observable will be emitted by the resulting Observable, even
7310
     * those emitted during failed subscriptions. For example, if an Observable fails at first but emits
7311
     * {@code [1, 2]} then succeeds the second time and emits {@code [1, 2, 3, 4, 5]} then the complete sequence
7312
     * of emissions and notifications would be {@code [1, 2, 1, 2, 3, 4, 5, onCompleted]}.
7313
     * <dl>
7314
     *  <dt><b>Scheduler:</b></dt>
7315
     *  <dd>{@code retry} operates by default on the {@code trampoline} {@link Scheduler}.</dd>
7316
     * </dl>
7317
     * 
7318
     * @return the source Observable modified with retry logic
7319
     * @see <a href="http://reactivex.io/documentation/operators/retry.html">ReactiveX operators documentation: Retry</a>
7320
     */
7321
    public final Observable<T> retry() {
7322 1 1. retry : mutated return of Object value for rx/Observable::retry to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OnSubscribeRedo.<T>retry(this);
7323
    }
7324
7325
    /**
7326
     * Returns an Observable that mirrors the source Observable, resubscribing to it if it calls {@code onError}
7327
     * up to a specified number of retries.
7328
     * <p>
7329
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/retry.png" alt="">
7330
     * <p>
7331
     * If the source Observable calls {@link Observer#onError}, this method will resubscribe to the source
7332
     * Observable for a maximum of {@code count} resubscriptions rather than propagating the
7333
     * {@code onError} call.
7334
     * <p>
7335
     * Any and all items emitted by the source Observable will be emitted by the resulting Observable, even
7336
     * those emitted during failed subscriptions. For example, if an Observable fails at first but emits
7337
     * {@code [1, 2]} then succeeds the second time and emits {@code [1, 2, 3, 4, 5]} then the complete sequence
7338
     * of emissions and notifications would be {@code [1, 2, 1, 2, 3, 4, 5, onCompleted]}.
7339
     * <dl>
7340
     *  <dt><b>Scheduler:</b></dt>
7341
     *  <dd>{@code retry} operates by default on the {@code trampoline} {@link Scheduler}.</dd>
7342
     * </dl>
7343
     * 
7344
     * @param count
7345
     *            number of retry attempts before failing
7346
     * @return the source Observable modified with retry logic
7347
     * @see <a href="http://reactivex.io/documentation/operators/retry.html">ReactiveX operators documentation: Retry</a>
7348
     */
7349
    public final Observable<T> retry(final long count) {
7350 1 1. retry : mutated return of Object value for rx/Observable::retry to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OnSubscribeRedo.<T>retry(this, count);
7351
    }
7352
7353
    /**
7354
     * Returns an Observable that mirrors the source Observable, resubscribing to it if it calls {@code onError}
7355
     * and the predicate returns true for that specific exception and retry count.
7356
     * <p>
7357
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/retry.png" alt="">
7358
     * <dl>
7359
     *  <dt><b>Backpressure Support:</b></dt>
7360
     *  <dd>This operator honors backpressure.</td>
7361
     *  <dt><b>Scheduler:</b></dt>
7362
     *  <dd>{@code retry} operates by default on the {@code trampoline} {@link Scheduler}.</dd>
7363
     * </dl>
7364
     *
7365
     * @param predicate
7366
     *            the predicate that determines if a resubscription may happen in case of a specific exception
7367
     *            and retry count
7368
     * @return the source Observable modified with retry logic
7369
     * @see #retry()
7370
     * @see <a href="http://reactivex.io/documentation/operators/retry.html">ReactiveX operators documentation: Retry</a>
7371
     */
7372
    public final Observable<T> retry(Func2<Integer, Throwable, Boolean> predicate) {
7373 1 1. retry : mutated return of Object value for rx/Observable::retry to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return nest().lift(new OperatorRetryWithPredicate<T>(predicate));
7374
    }
7375
7376
    /**
7377
     * Returns an Observable that emits the same values as the source observable with the exception of an
7378
     * {@code onError}. An {@code onError} notification from the source will result in the emission of a
7379
     * {@link Throwable} item to the Observable provided as an argument to the {@code notificationHandler}
7380
     * function. If that Observable calls {@code onComplete} or {@code onError} then {@code retry} will call
7381
     * {@code onCompleted} or {@code onError} on the child subscription. Otherwise, this Observable will
7382
     * resubscribe to the source Observable.    
7383
     * <p>
7384
     * <img width="640" height="430" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/retryWhen.f.png" alt="">
7385
     * 
7386
     * Example:
7387
     * 
7388
     * This retries 3 times, each time incrementing the number of seconds it waits.
7389
     * 
7390
     * <pre> {@code
7391
     *  Observable.create((Subscriber<? super String> s) -> {
7392
     *      System.out.println("subscribing");
7393
     *      s.onError(new RuntimeException("always fails"));
7394
     *  }).retryWhen(attempts -> {
7395
     *      return attempts.zipWith(Observable.range(1, 3), (n, i) -> i).flatMap(i -> {
7396
     *          System.out.println("delay retry by " + i + " second(s)");
7397
     *          return Observable.timer(i, TimeUnit.SECONDS);
7398
     *      });
7399
     *  }).toBlocking().forEach(System.out::println);
7400
     * } </pre>
7401
     * 
7402
     * Output is:
7403
     *
7404
     * <pre> {@code
7405
     * subscribing
7406
     * delay retry by 1 second(s)
7407
     * subscribing
7408
     * delay retry by 2 second(s)
7409
     * subscribing
7410
     * delay retry by 3 second(s)
7411
     * subscribing
7412
     * } </pre>
7413
     * <dl>
7414
     *  <dt><b>Scheduler:</b></dt>
7415
     *  <dd>{@code retryWhen} operates by default on the {@code trampoline} {@link Scheduler}.</dd>
7416
     * </dl>
7417
     *
7418
     * @param notificationHandler
7419
     *            receives an Observable of notifications with which a user can complete or error, aborting the
7420
     *            retry
7421
     * @return the source Observable modified with retry logic
7422
     * @see <a href="http://reactivex.io/documentation/operators/retry.html">ReactiveX operators documentation: Retry</a>
7423
     */
7424
    public final Observable<T> retryWhen(final Func1<? super Observable<? extends Throwable>, ? extends Observable<?>> notificationHandler) {
7425
        Func1<? super Observable<? extends Notification<?>>, ? extends Observable<?>> dematerializedNotificationHandler = new Func1<Observable<? extends Notification<?>>, Observable<?>>() {
7426
            @Override
7427
            public Observable<?> call(Observable<? extends Notification<?>> notifications) {
7428 1 1. call : mutated return of Object value for rx/Observable$24::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                return notificationHandler.call(notifications.map(new Func1<Notification<?>, Throwable>() {
7429
                    @Override
7430
                    public Throwable call(Notification<?> notification) {
7431 1 1. call : mutated return of Object value for rx/Observable$24$1::call to ( if (x != null) null else throw new RuntimeException ) → KILLED
                        return notification.getThrowable();
7432
                    }
7433
                }));
7434
            }
7435
        };
7436 1 1. retryWhen : mutated return of Object value for rx/Observable::retryWhen to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return OnSubscribeRedo.<T> retry(this, dematerializedNotificationHandler);
7437
    }
7438
7439
    /**
7440
     * Returns an Observable that emits the same values as the source observable with the exception of an
7441
     * {@code onError}. An {@code onError} will cause the emission of the {@link Throwable} that cause the
7442
     * error to the Observable returned from {@code notificationHandler}. If that Observable calls
7443
     * {@code onComplete} or {@code onError} then {@code retry} will call {@code onCompleted} or {@code onError}
7444
     * on the child subscription. Otherwise, this Observable will resubscribe to the source observable, on a
7445
     * particular Scheduler.    
7446
     * <p>
7447
     * <img width="640" height="430" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/retryWhen.f.png" alt="">
7448
     * <p>
7449
     * <dl>
7450
     *  <dt><b>Scheduler:</b></dt>
7451
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7452
     * </dl>
7453
     *
7454
     * @param notificationHandler
7455
     *            receives an Observable of notifications with which a user can complete or error, aborting the
7456
     *            retry
7457
     * @param scheduler
7458
     *            the {@link Scheduler} on which to subscribe to the source Observable
7459
     * @return the source Observable modified with retry logic
7460
     * @see <a href="http://reactivex.io/documentation/operators/retry.html">ReactiveX operators documentation: Retry</a>
7461
     */
7462
    public final Observable<T> retryWhen(final Func1<? super Observable<? extends Throwable>, ? extends Observable<?>> notificationHandler, Scheduler scheduler) {
7463
        Func1<? super Observable<? extends Notification<?>>, ? extends Observable<?>> dematerializedNotificationHandler = new Func1<Observable<? extends Notification<?>>, Observable<?>>() {
7464
            @Override
7465
            public Observable<?> call(Observable<? extends Notification<?>> notifications) {
7466 1 1. call : mutated return of Object value for rx/Observable$25::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                return notificationHandler.call(notifications.map(new Func1<Notification<?>, Throwable>() {
7467
                    @Override
7468
                    public Throwable call(Notification<?> notification) {
7469 1 1. call : mutated return of Object value for rx/Observable$25$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
                        return notification.getThrowable();
7470
                    }
7471
                }));
7472
            }
7473
        };
7474 1 1. retryWhen : mutated return of Object value for rx/Observable::retryWhen to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return OnSubscribeRedo.<T> retry(this, dematerializedNotificationHandler, scheduler);
7475
    }
7476
7477
    /**
7478
     * Returns an Observable that emits the most recently emitted item (if any) emitted by the source Observable
7479
     * within periodic time intervals.
7480
     * <p>
7481
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.png" alt="">
7482
     * <dl>
7483
     *  <dt><b>Backpressure Support:</b></dt>
7484
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
7485
     *  <dt><b>Scheduler:</b></dt>
7486
     *  <dd>{@code sample} operates by default on the {@code computation} {@link Scheduler}.</dd>
7487
     * </dl>
7488
     * 
7489
     * @param period
7490
     *            the sampling rate
7491
     * @param unit
7492
     *            the {@link TimeUnit} in which {@code period} is defined
7493
     * @return an Observable that emits the results of sampling the items emitted by the source Observable at
7494
     *         the specified time interval
7495
     * @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
7496
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
7497
     * @see #throttleLast(long, TimeUnit)
7498
     */
7499
    public final Observable<T> sample(long period, TimeUnit unit) {
7500 1 1. sample : mutated return of Object value for rx/Observable::sample to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return sample(period, unit, Schedulers.computation());
7501
    }
7502
7503
    /**
7504
     * Returns an Observable that emits the most recently emitted item (if any) emitted by the source Observable
7505
     * within periodic time intervals, where the intervals are defined on a particular Scheduler.
7506
     * <p>
7507
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.s.png" alt="">
7508
     * <dl>
7509
     *  <dt><b>Backpressure Support:</b></dt>
7510
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
7511
     *  <dt><b>Scheduler:</b></dt>
7512
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7513
     * </dl>
7514
     * 
7515
     * @param period
7516
     *            the sampling rate
7517
     * @param unit
7518
     *            the {@link TimeUnit} in which {@code period} is defined
7519
     * @param scheduler
7520
     *            the {@link Scheduler} to use when sampling
7521
     * @return an Observable that emits the results of sampling the items emitted by the source Observable at
7522
     *         the specified time interval
7523
     * @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
7524
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
7525
     * @see #throttleLast(long, TimeUnit, Scheduler)
7526
     */
7527
    public final Observable<T> sample(long period, TimeUnit unit, Scheduler scheduler) {
7528 1 1. sample : mutated return of Object value for rx/Observable::sample to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSampleWithTime<T>(period, unit, scheduler));
7529
    }
7530
7531
    /**
7532
     * Returns an Observable that, when the specified {@code sampler} Observable emits an item or completes,
7533
     * emits the most recently emitted item (if any) emitted by the source Observable since the previous
7534
     * emission from the {@code sampler} Observable.
7535
     * <p>
7536
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.png" alt="">
7537
     * <dl>
7538
     *  <dt><b>Backpressure Support:</b></dt>
7539
     *  <dd>This operator does not support backpressure as it uses the emissions of the {@code sampler}
7540
     *      Observable to control data flow.</dd>
7541
     *  <dt><b>Scheduler:</b></dt>
7542
     *  <dd>This version of {@code sample} does not operate by default on a particular {@link Scheduler}.</dd>
7543
     * </dl>
7544
     * 
7545
     * @param sampler
7546
     *            the Observable to use for sampling the source Observable
7547
     * @return an Observable that emits the results of sampling the items emitted by this Observable whenever
7548
     *         the {@code sampler} Observable emits an item or completes
7549
     * @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
7550
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
7551
     */
7552
    public final <U> Observable<T> sample(Observable<U> sampler) {
7553 1 1. sample : mutated return of Object value for rx/Observable::sample to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSampleWithObservable<T, U>(sampler));
7554
    }
7555
7556
    /**
7557
     * Returns an Observable that applies a specified accumulator function to the first item emitted by a source
7558
     * Observable, then feeds the result of that function along with the second item emitted by the source
7559
     * Observable into the same function, and so on until all items have been emitted by the source Observable,
7560
     * emitting the result of each of these iterations.
7561
     * <p>
7562
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scan.png" alt="">
7563
     * <p>
7564
     * This sort of function is sometimes called an accumulator.
7565
     * <dl>
7566
     *  <dt><b>Scheduler:</b></dt>
7567
     *  <dd>{@code scan} does not operate by default on a particular {@link Scheduler}.</dd>
7568
     * </dl>
7569
     * 
7570
     * @param accumulator
7571
     *            an accumulator function to be invoked on each item emitted by the source Observable, whose
7572
     *            result will be emitted to {@link Observer}s via {@link Observer#onNext onNext} and used in the
7573
     *            next accumulator call
7574
     * @return an Observable that emits the results of each call to the accumulator function
7575
     * @see <a href="http://reactivex.io/documentation/operators/scan.html">ReactiveX operators documentation: Scan</a>
7576
     */
7577
    public final Observable<T> scan(Func2<T, T, T> accumulator) {
7578 1 1. scan : mutated return of Object value for rx/Observable::scan to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorScan<T, T>(accumulator));
7579
    }
7580
7581
    /**
7582
     * Returns an Observable that applies a specified accumulator function to the first item emitted by a source
7583
     * Observable and a seed value, then feeds the result of that function along with the second item emitted by
7584
     * the source Observable into the same function, and so on until all items have been emitted by the source
7585
     * Observable, emitting the result of each of these iterations.
7586
     * <p>
7587
     * <img width="640" height="320" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/scanSeed.png" alt="">
7588
     * <p>
7589
     * This sort of function is sometimes called an accumulator.
7590
     * <p>
7591
     * Note that the Observable that results from this method will emit {@code initialValue} as its first
7592
     * emitted item.
7593
     * <dl>
7594
     *  <dt><b>Scheduler:</b></dt>
7595
     *  <dd>{@code scan} does not operate by default on a particular {@link Scheduler}.</dd>
7596
     * </dl>
7597
     * 
7598
     * @param initialValue
7599
     *            the initial (seed) accumulator item
7600
     * @param accumulator
7601
     *            an accumulator function to be invoked on each item emitted by the source Observable, whose
7602
     *            result will be emitted to {@link Observer}s via {@link Observer#onNext onNext} and used in the
7603
     *            next accumulator call
7604
     * @return an Observable that emits {@code initialValue} followed by the results of each call to the
7605
     *         accumulator function
7606
     * @see <a href="http://reactivex.io/documentation/operators/scan.html">ReactiveX operators documentation: Scan</a>
7607
     */
7608
    public final <R> Observable<R> scan(R initialValue, Func2<R, ? super T, R> accumulator) {
7609 1 1. scan : mutated return of Object value for rx/Observable::scan to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorScan<R, T>(initialValue, accumulator));
7610
    }
7611
7612
    /**
7613
     * Forces an Observable's emissions and notifications to be serialized and for it to obey
7614
     * <a href="http://reactivex.io/documentation/contract.html">the Observable contract</a> in other ways.
7615
     * <p>
7616
     * It is possible for an Observable to invoke its Subscribers' methods asynchronously, perhaps from
7617
     * different threads. This could make such an Observable poorly-behaved, in that it might try to invoke
7618
     * {@code onCompleted} or {@code onError} before one of its {@code onNext} invocations, or it might call
7619
     * {@code onNext} from two different threads concurrently. You can force such an Observable to be
7620
     * well-behaved and sequential by applying the {@code serialize} method to it.
7621
     * <p>
7622
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/synchronize.png" alt="">
7623
     * <dl>
7624
     *  <dt><b>Scheduler:</b></dt>
7625
     *  <dd>{@code serialize} does not operate by default on a particular {@link Scheduler}.</dd>
7626
     * </dl>
7627
     *
7628
     * @return an {@link Observable} that is guaranteed to be well-behaved and to make only serialized calls to
7629
     *         its observers
7630
     * @see <a href="http://reactivex.io/documentation/operators/serialize.html">ReactiveX operators documentation: Serialize</a>
7631
     */
7632
    public final Observable<T> serialize() {
7633 1 1. serialize : mutated return of Object value for rx/Observable::serialize to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorSerialize.<T>instance());
7634
    }
7635
7636
    /**
7637
     * Returns a new {@link Observable} that multicasts (shares) the original {@link Observable}. As long as
7638
     * there is at least one {@link Subscriber} this {@link Observable} will be subscribed and emitting data. 
7639
     * When all subscribers have unsubscribed it will unsubscribe from the source {@link Observable}. 
7640
     * <p>
7641
     * This is an alias for {@link #publish()}.{@link ConnectableObservable#refCount()}.
7642
     * <p>
7643
     * <img width="640" height="510" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/publishRefCount.png" alt="">
7644
     * <dl>
7645
     *  <dt><b>Backpressure Support:</b></dt>
7646
     *  <dd>This operator does not support backpressure because multicasting means the stream is "hot" with
7647
     *      multiple subscribers. Each child will need to manage backpressure independently using operators such
7648
     *      as {@link #onBackpressureDrop} and {@link #onBackpressureBuffer}.</dd>
7649
     *  <dt><b>Scheduler:</b></dt>
7650
     *  <dd>{@code share} does not operate by default on a particular {@link Scheduler}.</dd>
7651
     * </dl>
7652
     * 
7653
     * @return an {@code Observable} that upon connection causes the source {@code Observable} to emit items
7654
     *         to its {@link Observer}s
7655
     * @see <a href="http://reactivex.io/documentation/operators/refcount.html">ReactiveX operators documentation: RefCount</a>
7656
     */
7657
    public final Observable<T> share() {
7658 1 1. share : mutated return of Object value for rx/Observable::share to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return publish().refCount();
7659
    }
7660
    
7661
    /**
7662
     * Returns an Observable that emits the single item emitted by the source Observable, if that Observable
7663
     * emits only a single item. If the source Observable emits more than one item or no items, notify of an
7664
     * {@code IllegalArgumentException} or {@code NoSuchElementException} respectively.
7665
     * <p>
7666
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/single.png" alt="">
7667
     * <dl>
7668
     *  <dt><b>Scheduler:</b></dt>
7669
     *  <dd>{@code single} does not operate by default on a particular {@link Scheduler}.</dd>
7670
     * </dl>
7671
     * 
7672
     * @return an Observable that emits the single item emitted by the source Observable
7673
     * @throws IllegalArgumentException
7674
     *             if the source emits more than one item
7675
     * @throws NoSuchElementException
7676
     *             if the source emits no items
7677
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
7678
     */
7679
    public final Observable<T> single() {
7680 1 1. single : mutated return of Object value for rx/Observable::single to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorSingle.<T> instance());
7681
    }
7682
7683
    /**
7684
     * Returns an Observable that emits the single item emitted by the source Observable that matches a
7685
     * specified predicate, if that Observable emits one such item. If the source Observable emits more than one
7686
     * such item or no such items, notify of an {@code IllegalArgumentException} or
7687
     * {@code NoSuchElementException} respectively.
7688
     * <p>
7689
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/single.p.png" alt="">
7690
     * <dl>
7691
     *  <dt><b>Scheduler:</b></dt>
7692
     *  <dd>{@code single} does not operate by default on a particular {@link Scheduler}.</dd>
7693
     * </dl>
7694
     * 
7695
     * @param predicate
7696
     *            a predicate function to evaluate items emitted by the source Observable
7697
     * @return an Observable that emits the single item emitted by the source Observable that matches the
7698
     *         predicate
7699
     * @throws IllegalArgumentException
7700
     *             if the source Observable emits more than one item that matches the predicate
7701
     * @throws NoSuchElementException
7702
     *             if the source Observable emits no item that matches the predicate
7703
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
7704
     */
7705
    public final Observable<T> single(Func1<? super T, Boolean> predicate) {
7706 1 1. single : mutated return of Object value for rx/Observable::single to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return filter(predicate).single();
7707
    }
7708
7709
    /**
7710
     * Returns an Observable that emits the single item emitted by the source Observable, if that Observable
7711
     * emits only a single item, or a default item if the source Observable emits no items. If the source
7712
     * Observable emits more than one item, throw an {@code IllegalArgumentException}.
7713
     * <p>
7714
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/singleOrDefault.png" alt="">
7715
     * <dl>
7716
     *  <dt><b>Scheduler:</b></dt>
7717
     *  <dd>{@code singleOrDefault} does not operate by default on a particular {@link Scheduler}.</dd>
7718
     * </dl>
7719
     * 
7720
     * @param defaultValue
7721
     *            a default value to emit if the source Observable emits no item
7722
     * @return an Observable that emits the single item emitted by the source Observable, or a default item if
7723
     *         the source Observable is empty
7724
     * @throws IllegalArgumentException
7725
     *             if the source Observable emits more than one item
7726
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
7727
     */
7728
    public final Observable<T> singleOrDefault(T defaultValue) {
7729 1 1. singleOrDefault : mutated return of Object value for rx/Observable::singleOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSingle<T>(defaultValue));
7730
    }
7731
7732
    /**
7733
     * Returns an Observable that emits the single item emitted by the source Observable that matches a
7734
     * predicate, if that Observable emits only one such item, or a default item if the source Observable emits
7735
     * no such items. If the source Observable emits more than one such item, throw an
7736
     * {@code IllegalArgumentException}.
7737
     * <p>
7738
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/singleOrDefault.p.png" alt="">
7739
     * <dl>
7740
     *  <dt><b>Scheduler:</b></dt>
7741
     *  <dd>{@code singleOrDefault} does not operate by default on a particular {@link Scheduler}.</dd>
7742
     * </dl>
7743
     * 
7744
     * @param defaultValue
7745
     *            a default item to emit if the source Observable emits no matching items
7746
     * @param predicate
7747
     *            a predicate function to evaluate items emitted by the source Observable
7748
     * @return an Observable that emits the single item emitted by the source Observable that matches the
7749
     *         predicate, or the default item if no emitted item matches the predicate
7750
     * @throws IllegalArgumentException
7751
     *             if the source Observable emits more than one item that matches the predicate
7752
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
7753
     */
7754
    public final Observable<T> singleOrDefault(T defaultValue, Func1<? super T, Boolean> predicate) {
7755 1 1. singleOrDefault : mutated return of Object value for rx/Observable::singleOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return filter(predicate).singleOrDefault(defaultValue);
7756
    }
7757
7758
    /**
7759
     * Returns an Observable that skips the first {@code count} items emitted by the source Observable and emits
7760
     * the remainder.
7761
     * <p>
7762
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.png" alt="">
7763
     * <dl>
7764
     *  <dt><b>Scheduler:</b></dt>
7765
     *  <dd>This version of {@code skip} does not operate by default on a particular {@link Scheduler}.</dd>
7766
     * </dl>
7767
     * 
7768
     * @param count
7769
     *            the number of items to skip
7770
     * @return an Observable that is identical to the source Observable except that it does not emit the first
7771
     *         {@code count} items that the source Observable emits
7772
     * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
7773
     */
7774
    public final Observable<T> skip(int count) {
7775 1 1. skip : mutated return of Object value for rx/Observable::skip to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSkip<T>(count));
7776
    }
7777
7778
    /**
7779
     * Returns an Observable that skips values emitted by the source Observable before a specified time window
7780
     * elapses.
7781
     * <p>
7782
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.t.png" alt="">
7783
     * <dl>
7784
     *  <dt><b>Scheduler:</b></dt>
7785
     *  <dd>This version of {@code skip} operates by default on the {@code computation} {@link Scheduler}.</dd>
7786
     * </dl>
7787
     * 
7788
     * @param time
7789
     *            the length of the time window to skip
7790
     * @param unit
7791
     *            the time unit of {@code time}
7792
     * @return an Observable that skips values emitted by the source Observable before the time window defined
7793
     *         by {@code time} elapses and the emits the remainder
7794
     * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
7795
     */
7796
    public final Observable<T> skip(long time, TimeUnit unit) {
7797 1 1. skip : mutated return of Object value for rx/Observable::skip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return skip(time, unit, Schedulers.computation());
7798
    }
7799
7800
    /**
7801
     * Returns an Observable that skips values emitted by the source Observable before a specified time window
7802
     * on a specified {@link Scheduler} elapses.
7803
     * <p>
7804
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.ts.png" alt="">
7805
     * <dl>
7806
     *  <dt><b>Scheduler:</b></dt>
7807
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7808
     * </dl>
7809
     * 
7810
     * @param time
7811
     *            the length of the time window to skip
7812
     * @param unit
7813
     *            the time unit of {@code time}
7814
     * @param scheduler
7815
     *            the {@link Scheduler} on which the timed wait happens
7816
     * @return an Observable that skips values emitted by the source Observable before the time window defined
7817
     *         by {@code time} and {@code scheduler} elapses, and then emits the remainder
7818
     * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
7819
     */
7820
    public final Observable<T> skip(long time, TimeUnit unit, Scheduler scheduler) {
7821 1 1. skip : mutated return of Object value for rx/Observable::skip to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSkipTimed<T>(time, unit, scheduler));
7822
    }
7823
7824
    /**
7825
     * Returns an Observable that drops a specified number of items from the end of the sequence emitted by the
7826
     * source Observable.
7827
     * <p>
7828
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipLast.png" alt="">
7829
     * <p>
7830
     * This Observer accumulates a queue long enough to store the first {@code count} items. As more items are
7831
     * received, items are taken from the front of the queue and emitted by the returned Observable. This causes
7832
     * such items to be delayed.
7833
     * <dl>
7834
     *  <dt><b>Scheduler:</b></dt>
7835
     *  <dd>This version of {@code skipLast} does not operate by default on a particular {@link Scheduler}.</dd>
7836
     * </dl>
7837
     * 
7838
     * @param count
7839
     *            number of items to drop from the end of the source sequence
7840
     * @return an Observable that emits the items emitted by the source Observable except for the dropped ones
7841
     *         at the end
7842
     * @throws IndexOutOfBoundsException
7843
     *             if {@code count} is less than zero
7844
     * @see <a href="http://reactivex.io/documentation/operators/skiplast.html">ReactiveX operators documentation: SkipLast</a>
7845
     */
7846
    public final Observable<T> skipLast(int count) {
7847 1 1. skipLast : mutated return of Object value for rx/Observable::skipLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSkipLast<T>(count));
7848
    }
7849
7850
    /**
7851
     * Returns an Observable that drops items emitted by the source Observable during a specified time window
7852
     * before the source completes.
7853
     * <p>
7854
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipLast.t.png" alt="">
7855
     * <p>
7856
     * Note: this action will cache the latest items arriving in the specified time window.
7857
     * <dl>
7858
     *  <dt><b>Scheduler:</b></dt>
7859
     *  <dd>This version of {@code skipLast} operates by default on the {@code computation} {@link Scheduler}.</dd>
7860
     * </dl>
7861
     * 
7862
     * @param time
7863
     *            the length of the time window
7864
     * @param unit
7865
     *            the time unit of {@code time}
7866
     * @return an Observable that drops those items emitted by the source Observable in a time window before the
7867
     *         source completes defined by {@code time}
7868
     * @see <a href="http://reactivex.io/documentation/operators/skiplast.html">ReactiveX operators documentation: SkipLast</a>
7869
     */
7870
    public final Observable<T> skipLast(long time, TimeUnit unit) {
7871 1 1. skipLast : mutated return of Object value for rx/Observable::skipLast to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return skipLast(time, unit, Schedulers.computation());
7872
    }
7873
7874
    /**
7875
     * Returns an Observable that drops items emitted by the source Observable during a specified time window
7876
     * (defined on a specified scheduler) before the source completes.
7877
     * <p>
7878
     * <img width="640" height="340" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipLast.ts.png" alt="">
7879
     * <p>
7880
     * Note: this action will cache the latest items arriving in the specified time window.
7881
     * <dl>
7882
     *  <dt><b>Scheduler:</b></dt>
7883
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
7884
     * </dl>
7885
     *
7886
     * @param time
7887
     *            the length of the time window
7888
     * @param unit
7889
     *            the time unit of {@code time}
7890
     * @param scheduler
7891
     *            the scheduler used as the time source
7892
     * @return an Observable that drops those items emitted by the source Observable in a time window before the
7893
     *         source completes defined by {@code time} and {@code scheduler}
7894
     * @see <a href="http://reactivex.io/documentation/operators/skiplast.html">ReactiveX operators documentation: SkipLast</a>
7895
     */
7896
    public final Observable<T> skipLast(long time, TimeUnit unit, Scheduler scheduler) {
7897 1 1. skipLast : mutated return of Object value for rx/Observable::skipLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSkipLastTimed<T>(time, unit, scheduler));
7898
    }
7899
7900
    /**
7901
     * Returns an Observable that skips items emitted by the source Observable until a second Observable emits
7902
     * an item.
7903
     * <p>
7904
     * <img width="640" height="375" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipUntil.png" alt="">
7905
     * <dl>
7906
     *  <dt><b>Scheduler:</b></dt>
7907
     *  <dd>{@code skipUntil} does not operate by default on a particular {@link Scheduler}.</dd>
7908
     * </dl>
7909
     * 
7910
     * @param other
7911
     *            the second Observable that has to emit an item before the source Observable's elements begin
7912
     *            to be mirrored by the resulting Observable
7913
     * @return an Observable that skips items from the source Observable until the second Observable emits an
7914
     *         item, then emits the remaining items
7915
     * @see <a href="http://reactivex.io/documentation/operators/skipuntil.html">ReactiveX operators documentation: SkipUntil</a>
7916
     */
7917
    public final <U> Observable<T> skipUntil(Observable<U> other) {
7918 1 1. skipUntil : mutated return of Object value for rx/Observable::skipUntil to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSkipUntil<T, U>(other));
7919
    }
7920
7921
    /**
7922
     * Returns an Observable that skips all items emitted by the source Observable as long as a specified
7923
     * condition holds true, but emits all further source items as soon as the condition becomes false.
7924
     * <p>
7925
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skipWhile.png" alt="">
7926
     * <dl>
7927
     *  <dt><b>Scheduler:</b></dt>
7928
     *  <dd>{@code skipWhile} does not operate by default on a particular {@link Scheduler}.</dd>
7929
     * </dl>
7930
     * 
7931
     * @param predicate
7932
     *            a function to test each item emitted from the source Observable
7933
     * @return an Observable that begins emitting items emitted by the source Observable when the specified
7934
     *         predicate becomes false
7935
     * @see <a href="http://reactivex.io/documentation/operators/skipwhile.html">ReactiveX operators documentation: SkipWhile</a>
7936
     */
7937
    public final Observable<T> skipWhile(Func1<? super T, Boolean> predicate) {
7938 1 1. skipWhile : mutated return of Object value for rx/Observable::skipWhile to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorSkipWhile<T>(OperatorSkipWhile.toPredicate2(predicate)));
7939
    }
7940
7941
    /**
7942
     * Returns an Observable that emits the items in a specified {@link Observable} before it begins to emit
7943
     * items emitted by the source Observable.
7944
     * <p>
7945
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.o.png" alt="">
7946
     * <dl>
7947
     *  <dt><b>Scheduler:</b></dt>
7948
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
7949
     * </dl>
7950
     * 
7951
     * @param values
7952
     *            an Observable that contains the items you want the modified Observable to emit first
7953
     * @return an Observable that emits the items in the specified {@link Observable} and then emits the items
7954
     *         emitted by the source Observable
7955
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
7956
     */
7957
    public final Observable<T> startWith(Observable<T> values) {
7958 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concat(values, this);
7959
    }
7960
7961
    /**
7962
     * Returns an Observable that emits the items in a specified {@link Iterable} before it begins to emit items
7963
     * emitted by the source Observable.
7964
     * <p>
7965
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
7966
     * <dl>
7967
     *  <dt><b>Scheduler:</b></dt>
7968
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
7969
     * </dl>
7970
     * 
7971
     * @param values
7972
     *            an Iterable that contains the items you want the modified Observable to emit first
7973
     * @return an Observable that emits the items in the specified {@link Iterable} and then emits the items
7974
     *         emitted by the source Observable
7975
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
7976
     */
7977
    public final Observable<T> startWith(Iterable<T> values) {
7978 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concat(Observable.<T> from(values), this);
7979
    }
7980
7981
    /**
7982
     * Returns an Observable that emits a specified item before it begins to emit items emitted by the source
7983
     * Observable.
7984
     * <p>
7985
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
7986
     * <dl>
7987
     *  <dt><b>Scheduler:</b></dt>
7988
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
7989
     * </dl>
7990
     * 
7991
     * @param t1
7992
     *            the item to emit
7993
     * @return an Observable that emits the specified item before it begins to emit items emitted by the source
7994
     *         Observable
7995
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
7996
     */
7997
    public final Observable<T> startWith(T t1) {
7998 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return concat(just(t1), this);
7999
    }
8000
8001
    /**
8002
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8003
     * Observable.
8004
     * <p>
8005
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8006
     * <dl>
8007
     *  <dt><b>Scheduler:</b></dt>
8008
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8009
     * </dl>
8010
     * 
8011
     * @param t1
8012
     *            the first item to emit
8013
     * @param t2
8014
     *            the second item to emit
8015
     * @return an Observable that emits the specified items before it begins to emit items emitted by the source
8016
     *         Observable
8017
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8018
     */
8019
    public final Observable<T> startWith(T t1, T t2) {
8020 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2), this);
8021
    }
8022
8023
    /**
8024
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8025
     * Observable.
8026
     * <p>
8027
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8028
     * <dl>
8029
     *  <dt><b>Scheduler:</b></dt>
8030
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8031
     * </dl>
8032
     * 
8033
     * @param t1
8034
     *            the first item to emit
8035
     * @param t2
8036
     *            the second item to emit
8037
     * @param t3
8038
     *            the third item to emit
8039
     * @return an Observable that emits the specified items before it begins to emit items emitted by the source
8040
     *         Observable
8041
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8042
     */
8043
    public final Observable<T> startWith(T t1, T t2, T t3) {
8044 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3), this);
8045
    }
8046
8047
    /**
8048
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8049
     * Observable.
8050
     * <p>
8051
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8052
     * <dl>
8053
     *  <dt><b>Scheduler:</b></dt>
8054
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8055
     * </dl>
8056
     * 
8057
     * @param t1
8058
     *            the first item to emit
8059
     * @param t2
8060
     *            the second item to emit
8061
     * @param t3
8062
     *            the third item to emit
8063
     * @param t4
8064
     *            the fourth item to emit
8065
     * @return an Observable that emits the specified items before it begins to emit items emitted by the source
8066
     *         Observable
8067
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8068
     */
8069
    public final Observable<T> startWith(T t1, T t2, T t3, T t4) {
8070 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4), this);
8071
    }
8072
8073
    /**
8074
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8075
     * Observable.
8076
     * <p>
8077
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8078
     * <dl>
8079
     *  <dt><b>Scheduler:</b></dt>
8080
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8081
     * </dl>
8082
     * 
8083
     * @param t1
8084
     *            the first item to emit
8085
     * @param t2
8086
     *            the second item to emit
8087
     * @param t3
8088
     *            the third item to emit
8089
     * @param t4
8090
     *            the fourth item to emit
8091
     * @param t5
8092
     *            the fifth item to emit
8093
     * @return an Observable that emits the specified items before it begins to emit items emitted by the source
8094
     *         Observable
8095
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8096
     */
8097
    public final Observable<T> startWith(T t1, T t2, T t3, T t4, T t5) {
8098 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5), this);
8099
    }
8100
8101
    /**
8102
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8103
     * Observable.
8104
     * <p>
8105
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8106
     * <dl>
8107
     *  <dt><b>Scheduler:</b></dt>
8108
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8109
     * </dl>
8110
     * 
8111
     * @param t1
8112
     *            the first item to emit
8113
     * @param t2
8114
     *            the second item to emit
8115
     * @param t3
8116
     *            the third item to emit
8117
     * @param t4
8118
     *            the fourth item to emit
8119
     * @param t5
8120
     *            the fifth item to emit
8121
     * @param t6
8122
     *            the sixth item to emit
8123
     * @return an Observable that emits the specified items before it begins to emit items emitted
8124
     *         by the source Observable
8125
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8126
     */
8127
    public final Observable<T> startWith(T t1, T t2, T t3, T t4, T t5, T t6) {
8128 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6), this);
8129
    }
8130
8131
    /**
8132
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8133
     * Observable.
8134
     * <p>
8135
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8136
     * <dl>
8137
     *  <dt><b>Scheduler:</b></dt>
8138
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8139
     * </dl>
8140
     * 
8141
     * @param t1
8142
     *            the first item to emit
8143
     * @param t2
8144
     *            the second item to emit
8145
     * @param t3
8146
     *            the third item to emit
8147
     * @param t4
8148
     *            the fourth item to emit
8149
     * @param t5
8150
     *            the fifth item to emit
8151
     * @param t6
8152
     *            the sixth item to emit
8153
     * @param t7
8154
     *            the seventh item to emit
8155
     * @return an Observable that emits the specified items before it begins to emit items emitted by the source
8156
     *         Observable
8157
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8158
     */
8159
    public final Observable<T> startWith(T t1, T t2, T t3, T t4, T t5, T t6, T t7) {
8160 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6, t7), this);
8161
    }
8162
8163
    /**
8164
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8165
     * Observable.
8166
     * <p>
8167
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8168
     * <dl>
8169
     *  <dt><b>Scheduler:</b></dt>
8170
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8171
     * </dl>
8172
     * 
8173
     * @param t1
8174
     *            the first item to emit
8175
     * @param t2
8176
     *            the second item to emit
8177
     * @param t3
8178
     *            the third item to emit
8179
     * @param t4
8180
     *            the fourth item to emit
8181
     * @param t5
8182
     *            the fifth item to emit
8183
     * @param t6
8184
     *            the sixth item to emit
8185
     * @param t7
8186
     *            the seventh item to emit
8187
     * @param t8
8188
     *            the eighth item to emit
8189
     * @return an Observable that emits the specified items before it begins to emit items emitted by the source
8190
     *         Observable
8191
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8192
     */
8193
    public final Observable<T> startWith(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8) {
8194 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6, t7, t8), this);
8195
    }
8196
8197
    /**
8198
     * Returns an Observable that emits the specified items before it begins to emit items emitted by the source
8199
     * Observable.
8200
     * <p>
8201
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/startWith.png" alt="">
8202
     * <dl>
8203
     *  <dt><b>Scheduler:</b></dt>
8204
     *  <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
8205
     * </dl>
8206
     * 
8207
     * @param t1
8208
     *            the first item to emit
8209
     * @param t2
8210
     *            the second item to emit
8211
     * @param t3
8212
     *            the third item to emit
8213
     * @param t4
8214
     *            the fourth item to emit
8215
     * @param t5
8216
     *            the fifth item to emit
8217
     * @param t6
8218
     *            the sixth item to emit
8219
     * @param t7
8220
     *            the seventh item to emit
8221
     * @param t8
8222
     *            the eighth item to emit
8223
     * @param t9
8224
     *            the ninth item to emit
8225
     * @return an Observable that emits the specified items before it begins to emit items emitted by the source
8226
     *         Observable
8227
     * @see <a href="http://reactivex.io/documentation/operators/startwith.html">ReactiveX operators documentation: StartWith</a>
8228
     */
8229
    public final Observable<T> startWith(T t1, T t2, T t3, T t4, T t5, T t6, T t7, T t8, T t9) {
8230 1 1. startWith : mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return concat(just(t1, t2, t3, t4, t5, t6, t7, t8, t9), this);
8231
    }
8232
8233
    /**
8234
     * Subscribes to an Observable and ignores {@code onNext} and {@code onCompleted} emissions. If an {@code onError} emission arrives then 
8235
     * {@link OnErrorNotImplementedException} is thrown. 
8236
     * <dl>
8237
     *  <dt><b>Scheduler:</b></dt>
8238
     *  <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
8239
     * </dl>
8240
     * 
8241
     * @return a {@link Subscription} reference with which the {@link Observer} can stop receiving items before
8242
     *         the Observable has finished sending them
8243
     * @throws OnErrorNotImplementedException
8244
     *             if the Observable tries to call {@code onError}
8245
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
8246
     */
8247
    public final Subscription subscribe() {
8248 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return subscribe(new Subscriber<T>() {
8249
8250
            @Override
8251
            public final void onCompleted() {
8252
                // do nothing
8253
            }
8254
8255
            @Override
8256
            public final void onError(Throwable e) {
8257
                throw new OnErrorNotImplementedException(e);
8258
            }
8259
8260
            @Override
8261
            public final void onNext(T args) {
8262
                // do nothing
8263
            }
8264
8265
        });
8266
    }
8267
8268
    /**
8269
     * Subscribes to an Observable and provides a callback to handle the items it emits.
8270
     * <dl>
8271
     *  <dt><b>Scheduler:</b></dt>
8272
     *  <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
8273
     * </dl>
8274
     * 
8275
     * @param onNext
8276
     *             the {@code Action1<T>} you have designed to accept emissions from the Observable
8277
     * @return a {@link Subscription} reference with which the {@link Observer} can stop receiving items before
8278
     *         the Observable has finished sending them
8279
     * @throws IllegalArgumentException
8280
     *             if {@code onNext} is null
8281
     * @throws OnErrorNotImplementedException
8282
     *             if the Observable calls {@code onError}
8283
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
8284
     */
8285
    public final Subscription subscribe(final Action1<? super T> onNext) {
8286 1 1. subscribe : negated conditional → KILLED
        if (onNext == null) {
8287
            throw new IllegalArgumentException("onNext can not be null");
8288
        }
8289
8290 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return subscribe(new Subscriber<T>() {
8291
8292
            @Override
8293
            public final void onCompleted() {
8294
                // do nothing
8295
            }
8296
8297
            @Override
8298
            public final void onError(Throwable e) {
8299
                throw new OnErrorNotImplementedException(e);
8300
            }
8301
8302
            @Override
8303
            public final void onNext(T args) {
8304 1 1. onNext : removed call to rx/functions/Action1::call → KILLED
                onNext.call(args);
8305
            }
8306
8307
        });
8308
    }
8309
8310
    /**
8311
     * Subscribes to an Observable and provides callbacks to handle the items it emits and any error
8312
     * notification it issues.
8313
     * <dl>
8314
     *  <dt><b>Scheduler:</b></dt>
8315
     *  <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
8316
     * </dl>
8317
     * 
8318
     * @param onNext
8319
     *             the {@code Action1<T>} you have designed to accept emissions from the Observable
8320
     * @param onError
8321
     *             the {@code Action1<Throwable>} you have designed to accept any error notification from the
8322
     *             Observable
8323
     * @return a {@link Subscription} reference with which the {@link Observer} can stop receiving items before
8324
     *         the Observable has finished sending them
8325
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
8326
     * @throws IllegalArgumentException
8327
     *             if {@code onNext} is null, or
8328
     *             if {@code onError} is null
8329
     */
8330
    public final Subscription subscribe(final Action1<? super T> onNext, final Action1<Throwable> onError) {
8331 1 1. subscribe : negated conditional → KILLED
        if (onNext == null) {
8332
            throw new IllegalArgumentException("onNext can not be null");
8333
        }
8334 1 1. subscribe : negated conditional → KILLED
        if (onError == null) {
8335
            throw new IllegalArgumentException("onError can not be null");
8336
        }
8337
8338 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
        return subscribe(new Subscriber<T>() {
8339
8340
            @Override
8341
            public final void onCompleted() {
8342
                // do nothing
8343
            }
8344
8345
            @Override
8346
            public final void onError(Throwable e) {
8347 1 1. onError : removed call to rx/functions/Action1::call → SURVIVED
                onError.call(e);
8348
            }
8349
8350
            @Override
8351
            public final void onNext(T args) {
8352 1 1. onNext : removed call to rx/functions/Action1::call → NO_COVERAGE
                onNext.call(args);
8353
            }
8354
8355
        });
8356
    }
8357
8358
    /**
8359
     * Subscribes to an Observable and provides callbacks to handle the items it emits and any error or
8360
     * completion notification it issues.
8361
     * <dl>
8362
     *  <dt><b>Scheduler:</b></dt>
8363
     *  <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
8364
     * </dl>
8365
     * 
8366
     * @param onNext
8367
     *             the {@code Action1<T>} you have designed to accept emissions from the Observable
8368
     * @param onError
8369
     *             the {@code Action1<Throwable>} you have designed to accept any error notification from the
8370
     *             Observable
8371
     * @param onComplete
8372
     *             the {@code Action0} you have designed to accept a completion notification from the
8373
     *             Observable
8374
     * @return a {@link Subscription} reference with which the {@link Observer} can stop receiving items before
8375
     *         the Observable has finished sending them
8376
     * @throws IllegalArgumentException
8377
     *             if {@code onNext} is null, or
8378
     *             if {@code onError} is null, or
8379
     *             if {@code onComplete} is null
8380
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
8381
     */
8382
    public final Subscription subscribe(final Action1<? super T> onNext, final Action1<Throwable> onError, final Action0 onComplete) {
8383 1 1. subscribe : negated conditional → KILLED
        if (onNext == null) {
8384
            throw new IllegalArgumentException("onNext can not be null");
8385
        }
8386 1 1. subscribe : negated conditional → KILLED
        if (onError == null) {
8387
            throw new IllegalArgumentException("onError can not be null");
8388
        }
8389 1 1. subscribe : negated conditional → KILLED
        if (onComplete == null) {
8390
            throw new IllegalArgumentException("onComplete can not be null");
8391
        }
8392
8393 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
        return subscribe(new Subscriber<T>() {
8394
8395
            @Override
8396
            public final void onCompleted() {
8397 1 1. onCompleted : removed call to rx/functions/Action0::call → SURVIVED
                onComplete.call();
8398
            }
8399
8400
            @Override
8401
            public final void onError(Throwable e) {
8402 1 1. onError : removed call to rx/functions/Action1::call → NO_COVERAGE
                onError.call(e);
8403
            }
8404
8405
            @Override
8406
            public final void onNext(T args) {
8407 1 1. onNext : removed call to rx/functions/Action1::call → SURVIVED
                onNext.call(args);
8408
            }
8409
8410
        });
8411
    }
8412
8413
    /**
8414
     * Subscribes to an Observable and provides an Observer that implements functions to handle the items the
8415
     * Observable emits and any error or completion notification it issues.
8416
     * <dl>
8417
     *  <dt><b>Scheduler:</b></dt>
8418
     *  <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
8419
     * </dl>
8420
     *
8421
     * @param observer
8422
     *             the Observer that will handle emissions and notifications from the Observable
8423
     * @return a {@link Subscription} reference with which the {@link Observer} can stop receiving items before
8424
     *         the Observable has completed
8425
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
8426
     */
8427
    public final Subscription subscribe(final Observer<? super T> observer) {
8428 1 1. subscribe : negated conditional → KILLED
        if (observer instanceof Subscriber) {
8429 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return subscribe((Subscriber<? super T>)observer);
8430
        }
8431 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return subscribe(new Subscriber<T>() {
8432
8433
            @Override
8434
            public void onCompleted() {
8435 1 1. onCompleted : removed call to rx/Observer::onCompleted → KILLED
                observer.onCompleted();
8436
            }
8437
8438
            @Override
8439
            public void onError(Throwable e) {
8440 1 1. onError : removed call to rx/Observer::onError → KILLED
                observer.onError(e);
8441
            }
8442
8443
            @Override
8444
            public void onNext(T t) {
8445 1 1. onNext : removed call to rx/Observer::onNext → KILLED
                observer.onNext(t);
8446
            }
8447
8448
        });
8449
    }
8450
8451
    /**
8452
     * Subscribes to an Observable and invokes {@link OnSubscribe} function without any contract protection,
8453
     * error handling, unsubscribe, or execution hooks.
8454
     * <p>
8455
     * Use this only for implementing an {@link Operator} that requires nested subscriptions. For other
8456
     * purposes, use {@link #subscribe(Subscriber)} which ensures
8457
     * <a href="http://reactivex.io/documentation/contract.html">the Observable contract</a> and other
8458
     * functionality.
8459
     * <dl>
8460
     *  <dt><b>Scheduler:</b></dt>
8461
     *  <dd>{@code unsafeSubscribe} does not operate by default on a particular {@link Scheduler}.</dd>
8462
     * </dl>
8463
     * 
8464
     * @param subscriber
8465
     *              the Subscriber that will handle emissions and notifications from the Observable
8466
     * @return a {@link Subscription} reference with which the {@link Subscriber} can stop receiving items
8467
     *         before the Observable has completed
8468
     */
8469
    public final Subscription unsafeSubscribe(Subscriber<? super T> subscriber) {
8470
        try {
8471
            // new Subscriber so onStart it
8472 1 1. unsafeSubscribe : removed call to rx/Subscriber::onStart → KILLED
            subscriber.onStart();
8473
            // allow the hook to intercept and/or decorate
8474 1 1. unsafeSubscribe : removed call to rx/Observable$OnSubscribe::call → KILLED
            hook.onSubscribeStart(this, onSubscribe).call(subscriber);
8475 1 1. unsafeSubscribe : mutated return of Object value for rx/Observable::unsafeSubscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return hook.onSubscribeReturn(subscriber);
8476
        } catch (Throwable e) {
8477
            // special handling for certain Throwable/Error/Exception types
8478 1 1. unsafeSubscribe : removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED
            Exceptions.throwIfFatal(e);
8479
            // if an unhandled error occurs executing the onSubscribe we will propagate it
8480
            try {
8481 1 1. unsafeSubscribe : removed call to rx/Subscriber::onError → KILLED
                subscriber.onError(hook.onSubscribeError(e));
8482
            } catch (Throwable e2) {
8483 1 1. unsafeSubscribe : removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED
                Exceptions.throwIfFatal(e2);
8484
                // if this happens it means the onError itself failed (perhaps an invalid function implementation)
8485
                // so we are unable to propagate the error correctly and will just throw
8486
                RuntimeException r = new RuntimeException("Error occurred attempting to subscribe [" + e.getMessage() + "] and then again while trying to pass to onError.", e2);
8487
                // TODO could the hook be the cause of the error in the on error handling.
8488
                hook.onSubscribeError(r);
8489
                // TODO why aren't we throwing the hook's return value.
8490
                throw r;
8491
            }
8492 1 1. unsafeSubscribe : mutated return of Object value for rx/Observable::unsafeSubscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
            return Subscriptions.unsubscribed();
8493
        }
8494
    }
8495
8496
    /**
8497
     * Subscribes to an Observable and provides a Subscriber that implements functions to handle the items the
8498
     * Observable emits and any error or completion notification it issues.
8499
     * <p>
8500
     * A typical implementation of {@code subscribe} does the following:
8501
     * <ol>
8502
     * <li>It stores a reference to the Subscriber in a collection object, such as a {@code List<T>} object.</li>
8503
     * <li>It returns a reference to the {@link Subscription} interface. This enables Subscribers to
8504
     * unsubscribe, that is, to stop receiving items and notifications before the Observable completes, which
8505
     * also invokes the Subscriber's {@link Subscriber#onCompleted onCompleted} method.</li>
8506
     * </ol><p>
8507
     * An {@code Observable<T>} instance is responsible for accepting all subscriptions and notifying all
8508
     * Subscribers. Unless the documentation for a particular {@code Observable<T>} implementation indicates
8509
     * otherwise, Subscriber should make no assumptions about the order in which multiple Subscribers will
8510
     * receive their notifications.
8511
     * <p>
8512
     * For more information see the
8513
     * <a href="http://reactivex.io/documentation/observable.html">ReactiveX documentation</a>.
8514
     * <dl>
8515
     *  <dt><b>Scheduler:</b></dt>
8516
     *  <dd>{@code subscribe} does not operate by default on a particular {@link Scheduler}.</dd>
8517
     * </dl>
8518
     * 
8519
     * @param subscriber
8520
     *            the {@link Subscriber} that will handle emissions and notifications from the Observable
8521
     * @return a {@link Subscription} reference with which Subscribers that are {@link Observer}s can
8522
     *         unsubscribe from the Observable
8523
     * @throws IllegalStateException
8524
     *             if {@code subscribe} is unable to obtain an {@code OnSubscribe<>} function
8525
     * @throws IllegalArgumentException
8526
     *             if the {@link Subscriber} provided as the argument to {@code subscribe} is {@code null}
8527
     * @throws OnErrorNotImplementedException
8528
     *             if the {@link Subscriber}'s {@code onError} method is null
8529
     * @throws RuntimeException
8530
     *             if the {@link Subscriber}'s {@code onError} method itself threw a {@code Throwable}
8531
     * @see <a href="http://reactivex.io/documentation/operators/subscribe.html">ReactiveX operators documentation: Subscribe</a>
8532
     */
8533
    public final Subscription subscribe(Subscriber<? super T> subscriber) {
8534 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return Observable.subscribe(subscriber, this);
8535
    }
8536
    
8537
    private static <T> Subscription subscribe(Subscriber<? super T> subscriber, Observable<T> observable) {
8538
     // validate and proceed
8539 1 1. subscribe : negated conditional → KILLED
        if (subscriber == null) {
8540
            throw new IllegalArgumentException("observer can not be null");
8541
        }
8542 1 1. subscribe : negated conditional → KILLED
        if (observable.onSubscribe == null) {
8543
            throw new IllegalStateException("onSubscribe function can not be null.");
8544
            /*
8545
             * the subscribe function can also be overridden but generally that's not the appropriate approach
8546
             * so I won't mention that in the exception
8547
             */
8548
        }
8549
        
8550
        // new Subscriber so onStart it
8551 1 1. subscribe : removed call to rx/Subscriber::onStart → KILLED
        subscriber.onStart();
8552
        
8553
        /*
8554
         * See https://github.com/ReactiveX/RxJava/issues/216 for discussion on "Guideline 6.4: Protect calls
8555
         * to user code from within an Observer"
8556
         */
8557
        // if not already wrapped
8558 1 1. subscribe : negated conditional → KILLED
        if (!(subscriber instanceof SafeSubscriber)) {
8559
            // assign to `observer` so we return the protected version
8560
            subscriber = new SafeSubscriber<T>(subscriber);
8561
        }
8562
8563
        // The code below is exactly the same an unsafeSubscribe but not used because it would 
8564
        // add a significant depth to already huge call stacks.
8565
        try {
8566
            // allow the hook to intercept and/or decorate
8567 1 1. subscribe : removed call to rx/Observable$OnSubscribe::call → KILLED
            hook.onSubscribeStart(observable, observable.onSubscribe).call(subscriber);
8568 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return hook.onSubscribeReturn(subscriber);
8569
        } catch (Throwable e) {
8570
            // special handling for certain Throwable/Error/Exception types
8571 1 1. subscribe : removed call to rx/exceptions/Exceptions::throwIfFatal → SURVIVED
            Exceptions.throwIfFatal(e);
8572
            // if an unhandled error occurs executing the onSubscribe we will propagate it
8573
            try {
8574 1 1. subscribe : removed call to rx/Subscriber::onError → KILLED
                subscriber.onError(hook.onSubscribeError(e));
8575
            } catch (Throwable e2) {
8576 1 1. subscribe : removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED
                Exceptions.throwIfFatal(e2);
8577
                // if this happens it means the onError itself failed (perhaps an invalid function implementation)
8578
                // so we are unable to propagate the error correctly and will just throw
8579
                RuntimeException r = new RuntimeException("Error occurred attempting to subscribe [" + e.getMessage() + "] and then again while trying to pass to onError.", e2);
8580
                // TODO could the hook be the cause of the error in the on error handling.
8581
                hook.onSubscribeError(r);
8582
                // TODO why aren't we throwing the hook's return value.
8583
                throw r;
8584
            }
8585 1 1. subscribe : mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
            return Subscriptions.unsubscribed();
8586
        }
8587
    }
8588
8589
    /**
8590
     * Asynchronously subscribes Observers to this Observable on the specified {@link Scheduler}.
8591
     * <p>
8592
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/subscribeOn.png" alt="">
8593
     * <dl>
8594
     *  <dt><b>Scheduler:</b></dt>
8595
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
8596
     * </dl>
8597
     * 
8598
     * @param scheduler
8599
     *            the {@link Scheduler} to perform subscription actions on
8600
     * @return the source Observable modified so that its subscriptions happen on the
8601
     *         specified {@link Scheduler}
8602
     * @see <a href="http://reactivex.io/documentation/operators/subscribeon.html">ReactiveX operators documentation: SubscribeOn</a>
8603
     * @see <a href="http://www.grahamlea.com/2014/07/rxjava-threading-examples/">RxJava Threading Examples</a>
8604
     * @see #observeOn
8605
     */
8606
    public final Observable<T> subscribeOn(Scheduler scheduler) {
8607 1 1. subscribeOn : negated conditional → KILLED
        if (this instanceof ScalarSynchronousObservable) {
8608 1 1. subscribeOn : mutated return of Object value for rx/Observable::subscribeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return ((ScalarSynchronousObservable<T>)this).scalarScheduleOn(scheduler);
8609
        }
8610 1 1. subscribeOn : mutated return of Object value for rx/Observable::subscribeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return create(new OperatorSubscribeOn<T>(this, scheduler));
8611
    }
8612
8613
    /**
8614
     * Returns a new Observable by applying a function that you supply to each item emitted by the source
8615
     * Observable that returns an Observable, and then emitting the items emitted by the most recently emitted
8616
     * of these Observables.
8617
     * <p>
8618
     * <img width="640" height="350" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchMap.png" alt="">
8619
     * <dl>
8620
     *  <dt><b>Scheduler:</b></dt>
8621
     *  <dd>{@code switchMap} does not operate by default on a particular {@link Scheduler}.</dd>
8622
     * </dl>
8623
     * 
8624
     * @param func
8625
     *            a function that, when applied to an item emitted by the source Observable, returns an
8626
     *            Observable
8627
     * @return an Observable that emits the items emitted by the Observable returned from applying {@code func} to the most recently emitted item emitted by the source Observable
8628
     * @see <a href="http://reactivex.io/documentation/operators/flatmap.html">ReactiveX operators documentation: FlatMap</a>
8629
     */
8630
    public final <R> Observable<R> switchMap(Func1<? super T, ? extends Observable<? extends R>> func) {
8631 1 1. switchMap : mutated return of Object value for rx/Observable::switchMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return switchOnNext(map(func));
8632
    }
8633
8634
    /**
8635
     * Returns an Observable that emits only the first {@code count} items emitted by the source Observable. If the source emits fewer than 
8636
     * {@code count} items then all of its items are emitted.
8637
     * <p>
8638
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/take.png" alt="">
8639
     * <p>
8640
     * This method returns an Observable that will invoke a subscribing {@link Observer}'s
8641
     * {@link Observer#onNext onNext} function a maximum of {@code count} times before invoking
8642
     * {@link Observer#onCompleted onCompleted}.
8643
     * <dl>
8644
     *  <dt><b>Scheduler:</b></dt>
8645
     *  <dd>This version of {@code take} does not operate by default on a particular {@link Scheduler}.</dd>
8646
     * </dl>
8647
     * 
8648
     * @param count
8649
     *            the maximum number of items to emit
8650
     * @return an Observable that emits only the first {@code count} items emitted by the source Observable, or
8651
     *         all of the items from the source Observable if that Observable emits fewer than {@code count} items
8652
     * @see <a href="http://reactivex.io/documentation/operators/take.html">ReactiveX operators documentation: Take</a>
8653
     */
8654
    public final Observable<T> take(final int count) {
8655 1 1. take : mutated return of Object value for rx/Observable::take to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTake<T>(count));
8656
    }
8657
8658
    /**
8659
     * Returns an Observable that emits those items emitted by source Observable before a specified time runs
8660
     * out.
8661
     * <p>
8662
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/take.t.png" alt="">
8663
     * <dl>
8664
     *  <dt><b>Scheduler:</b></dt>
8665
     *  <dd>This version of {@code take} operates by default on the {@code computation} {@link Scheduler}.</dd>
8666
     * </dl>
8667
     * 
8668
     * @param time
8669
     *            the length of the time window
8670
     * @param unit
8671
     *            the time unit of {@code time}
8672
     * @return an Observable that emits those items emitted by the source Observable before the time runs out
8673
     * @see <a href="http://reactivex.io/documentation/operators/take.html">ReactiveX operators documentation: Take</a>
8674
     */
8675
    public final Observable<T> take(long time, TimeUnit unit) {
8676 1 1. take : mutated return of Object value for rx/Observable::take to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return take(time, unit, Schedulers.computation());
8677
    }
8678
8679
    /**
8680
     * Returns an Observable that emits those items emitted by source Observable before a specified time (on a
8681
     * specified Scheduler) runs out.
8682
     * <p>
8683
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/take.ts.png" alt="">
8684
     * <dl>
8685
     *  <dt><b>Scheduler:</b></dt>
8686
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
8687
     * </dl>
8688
     * 
8689
     * @param time
8690
     *            the length of the time window
8691
     * @param unit
8692
     *            the time unit of {@code time}
8693
     * @param scheduler
8694
     *            the Scheduler used for time source
8695
     * @return an Observable that emits those items emitted by the source Observable before the time runs out,
8696
     *         according to the specified Scheduler
8697
     * @see <a href="http://reactivex.io/documentation/operators/take.html">ReactiveX operators documentation: Take</a>
8698
     */
8699
    public final Observable<T> take(long time, TimeUnit unit, Scheduler scheduler) {
8700 1 1. take : mutated return of Object value for rx/Observable::take to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTakeTimed<T>(time, unit, scheduler));
8701
    }
8702
8703
    /**
8704
     * Returns an Observable that emits only the very first item emitted by the source Observable that satisfies
8705
     * a specified condition.
8706
     * <p>
8707
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeFirstN.png" alt="">
8708
     * <dl>
8709
     *  <dt><b>Scheduler:</b></dt>
8710
     *  <dd>{@code takeFirst} does not operate by default on a particular {@link Scheduler}.</dd>
8711
     * </dl>
8712
     * 
8713
     * @param predicate
8714
     *            the condition any item emitted by the source Observable has to satisfy
8715
     * @return an Observable that emits only the very first item emitted by the source Observable that satisfies
8716
     *         the given condition, or that completes without emitting anything if the source Observable
8717
     *         completes without emitting a single condition-satisfying item
8718
     * @see <a href="http://reactivex.io/documentation/operators/first.html">ReactiveX operators documentation: First</a>
8719
     */
8720
    public final Observable<T> takeFirst(Func1<? super T, Boolean> predicate) {
8721 1 1. takeFirst : mutated return of Object value for rx/Observable::takeFirst to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return filter(predicate).take(1);
8722
    }
8723
8724
    /**
8725
     * Returns an Observable that emits at most the last {@code count} items emitted by the source Observable. If the source emits fewer than 
8726
     * {@code count} items then all of its items are emitted.
8727
     * <p>
8728
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLast.n.png" alt="">
8729
     * <dl>
8730
     *  <dt><b>Scheduler:</b></dt>
8731
     *  <dd>This version of {@code takeLast} does not operate by default on a particular {@link Scheduler}.</dd>
8732
     * </dl>
8733
     * 
8734
     * @param count
8735
     *            the maximum number of items to emit from the end of the sequence of items emitted by the source
8736
     *            Observable
8737
     * @return an Observable that emits at most the last {@code count} items emitted by the source Observable
8738
     * @throws IndexOutOfBoundsException
8739
     *             if {@code count} is less than zero
8740
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8741
     */
8742
    public final Observable<T> takeLast(final int count) {
8743 1 1. takeLast : negated conditional → KILLED
        if (count == 0)
8744 1 1. takeLast : mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return ignoreElements();
8745 1 1. takeLast : negated conditional → KILLED
        else if (count == 1 )
8746 1 1. takeLast : mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return lift(OperatorTakeLastOne.<T>instance());
8747
        else 
8748 1 1. takeLast : mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return lift(new OperatorTakeLast<T>(count));
8749
    }
8750
8751
    /**
8752
     * Returns an Observable that emits at most a specified number of items from the source Observable that were
8753
     * emitted in a specified window of time before the Observable completed. 
8754
     * <p>
8755
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLast.tn.png" alt="">
8756
     * <dl>
8757
     *  <dt><b>Scheduler:</b></dt>
8758
     *  <dd>This version of {@code takeLast} operates by default on the {@code computation} {@link Scheduler}.</dd>
8759
     * </dl>
8760
     * 
8761
     * @param count
8762
     *            the maximum number of items to emit
8763
     * @param time
8764
     *            the length of the time window
8765
     * @param unit
8766
     *            the time unit of {@code time}
8767
     * @return an Observable that emits at most {@code count} items from the source Observable that were emitted
8768
     *         in a specified window of time before the Observable completed
8769
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8770
     */
8771
    public final Observable<T> takeLast(int count, long time, TimeUnit unit) {
8772 1 1. takeLast : mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → SURVIVED
        return takeLast(count, time, unit, Schedulers.computation());
8773
    }
8774
8775
    /**
8776
     * Returns an Observable that emits at most a specified number of items from the source Observable that were
8777
     * emitted in a specified window of time before the Observable completed, where the timing information is
8778
     * provided by a given Scheduler.
8779
     * <p>
8780
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLast.tns.png" alt="">
8781
     * <dl>
8782
     *  <dt><b>Scheduler:</b></dt>
8783
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
8784
     * </dl>
8785
     * 
8786
     * @param count
8787
     *            the maximum number of items to emit
8788
     * @param time
8789
     *            the length of the time window
8790
     * @param unit
8791
     *            the time unit of {@code time}
8792
     * @param scheduler
8793
     *            the {@link Scheduler} that provides the timestamps for the observed items
8794
     * @return an Observable that emits at most {@code count} items from the source Observable that were emitted
8795
     *         in a specified window of time before the Observable completed, where the timing information is
8796
     *         provided by the given {@code scheduler}
8797
     * @throws IndexOutOfBoundsException
8798
     *             if {@code count} is less than zero
8799
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8800
     */
8801
    public final Observable<T> takeLast(int count, long time, TimeUnit unit, Scheduler scheduler) {
8802 1 1. takeLast : mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTakeLastTimed<T>(count, time, unit, scheduler));
8803
    }
8804
8805
    /**
8806
     * Returns an Observable that emits the items from the source Observable that were emitted in a specified
8807
     * window of time before the Observable completed.
8808
     * <p>
8809
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLast.t.png" alt="">
8810
     * <dl>
8811
     *  <dt><b>Scheduler:</b></dt>
8812
     *  <dd>This version of {@code takeLast} operates by default on the {@code computation} {@link Scheduler}.</dd>
8813
     * </dl>
8814
     * 
8815
     * @param time
8816
     *            the length of the time window
8817
     * @param unit
8818
     *            the time unit of {@code time}
8819
     * @return an Observable that emits the items from the source Observable that were emitted in the window of
8820
     *         time before the Observable completed specified by {@code time}
8821
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8822
     */
8823
    public final Observable<T> takeLast(long time, TimeUnit unit) {
8824 1 1. takeLast : mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return takeLast(time, unit, Schedulers.computation());
8825
    }
8826
8827
    /**
8828
     * Returns an Observable that emits the items from the source Observable that were emitted in a specified
8829
     * window of time before the Observable completed, where the timing information is provided by a specified
8830
     * Scheduler.
8831
     * <p>
8832
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLast.ts.png" alt="">
8833
     * <dl>
8834
     *  <dt><b>Scheduler:</b></dt>
8835
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
8836
     * </dl>
8837
     * 
8838
     * @param time
8839
     *            the length of the time window
8840
     * @param unit
8841
     *            the time unit of {@code time}
8842
     * @param scheduler
8843
     *            the Scheduler that provides the timestamps for the Observed items
8844
     * @return an Observable that emits the items from the source Observable that were emitted in the window of
8845
     *         time before the Observable completed specified by {@code time}, where the timing information is
8846
     *         provided by {@code scheduler}
8847
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8848
     */
8849
    public final Observable<T> takeLast(long time, TimeUnit unit, Scheduler scheduler) {
8850 1 1. takeLast : mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTakeLastTimed<T>(time, unit, scheduler));
8851
    }
8852
8853
    /**
8854
     * Returns an Observable that emits a single List containing at most the last {@code count} elements emitted by the
8855
     * source Observable. If the source emits fewer than {@code count} items then the emitted List will contain all of the source emissions.
8856
     * <p>
8857
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLastBuffer.png" alt="">
8858
     * <dl>
8859
     *  <dt><b>Scheduler:</b></dt>
8860
     *  <dd>This version of {@code takeLastBuffer} does not operate by default on a particular {@link Scheduler}.</dd>
8861
     * </dl>
8862
     * 
8863
     * @param count
8864
     *            the maximum number of items to emit in the list
8865
     * @return an Observable that emits a single list containing at most the last {@code count} elements emitted by the
8866
     *         source Observable
8867
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8868
     */
8869
    public final Observable<List<T>> takeLastBuffer(int count) {
8870 1 1. takeLastBuffer : mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return takeLast(count).toList();
8871
    }
8872
8873
    /**
8874
     * Returns an Observable that emits a single List containing at most {@code count} items from the source
8875
     * Observable that were emitted during a specified window of time before the source Observable completed.
8876
     * <p>
8877
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLastBuffer.tn.png" alt="">
8878
     * <dl>
8879
     *  <dt><b>Scheduler:</b></dt>
8880
     *  <dd>This version of {@code takeLastBuffer} operates by default on the {@code computation} {@link Scheduler}.</dd>
8881
     * </dl>
8882
     * 
8883
     * @param count
8884
     *            the maximum number of items to emit
8885
     * @param time
8886
     *            the length of the time window
8887
     * @param unit
8888
     *            the time unit of {@code time}
8889
     * @return an Observable that emits a single List containing at most {@code count} items emitted by the
8890
     *         source Observable during the time window defined by {@code time} before the source Observable
8891
     *         completed
8892
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8893
     */
8894
    public final Observable<List<T>> takeLastBuffer(int count, long time, TimeUnit unit) {
8895 1 1. takeLastBuffer : mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return takeLast(count, time, unit).toList();
8896
    }
8897
8898
    /**
8899
     * Returns an Observable that emits a single List containing at most {@code count} items from the source
8900
     * Observable that were emitted during a specified window of time (on a specified Scheduler) before the
8901
     * source Observable completed.
8902
     * <p>
8903
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLastBuffer.tns.png" alt="">
8904
     * <dl>
8905
     *  <dt><b>Scheduler:</b></dt>
8906
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
8907
     * </dl>
8908
     * 
8909
     * @param count
8910
     *            the maximum number of items to emit
8911
     * @param time
8912
     *            the length of the time window
8913
     * @param unit
8914
     *            the time unit of {@code time}
8915
     * @param scheduler
8916
     *            the Scheduler that provides the timestamps for the observed items
8917
     * @return an Observable that emits a single List containing at most {@code count} items emitted by the
8918
     *         source Observable during the time window defined by {@code time} before the source Observable
8919
     *         completed
8920
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8921
     */
8922
    public final Observable<List<T>> takeLastBuffer(int count, long time, TimeUnit unit, Scheduler scheduler) {
8923 1 1. takeLastBuffer : mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return takeLast(count, time, unit, scheduler).toList();
8924
    }
8925
8926
    /**
8927
     * Returns an Observable that emits a single List containing those items from the source Observable that
8928
     * were emitted during a specified window of time before the source Observable completed.
8929
     * <p>
8930
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLastBuffer.t.png" alt="">
8931
     * <dl>
8932
     *  <dt><b>Scheduler:</b></dt>
8933
     *  <dd>This version of {@code takeLastBuffer} operates by default on the {@code computation} {@link Scheduler}.</dd>
8934
     * </dl>
8935
     * 
8936
     * @param time
8937
     *            the length of the time window
8938
     * @param unit
8939
     *            the time unit of {@code time}
8940
     * @return an Observable that emits a single List containing the items emitted by the source Observable
8941
     *         during the time window defined by {@code time} before the source Observable completed
8942
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8943
     */
8944
    public final Observable<List<T>> takeLastBuffer(long time, TimeUnit unit) {
8945 1 1. takeLastBuffer : mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return takeLast(time, unit).toList();
8946
    }
8947
8948
    /**
8949
     * Returns an Observable that emits a single List containing those items from the source Observable that
8950
     * were emitted during a specified window of time before the source Observable completed, where the timing
8951
     * information is provided by the given Scheduler.
8952
     * <p>
8953
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeLastBuffer.ts.png" alt="">
8954
     * <dl>
8955
     *  <dt><b>Scheduler:</b></dt>
8956
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
8957
     * </dl>
8958
     * 
8959
     * @param time
8960
     *            the length of the time window
8961
     * @param unit
8962
     *            the time unit of {@code time}
8963
     * @param scheduler
8964
     *            the Scheduler that provides the timestamps for the observed items
8965
     * @return an Observable that emits a single List containing the items emitted by the source Observable
8966
     *         during the time window defined by {@code time} before the source Observable completed, where the
8967
     *         timing information is provided by {@code scheduler}
8968
     * @see <a href="http://reactivex.io/documentation/operators/takelast.html">ReactiveX operators documentation: TakeLast</a>
8969
     */
8970
    public final Observable<List<T>> takeLastBuffer(long time, TimeUnit unit, Scheduler scheduler) {
8971 1 1. takeLastBuffer : mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return takeLast(time, unit, scheduler).toList();
8972
    }
8973
8974
    /**
8975
     * Returns an Observable that emits the items emitted by the source Observable until a second Observable
8976
     * emits an item.
8977
     * <p>
8978
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeUntil.png" alt="">
8979
     * <dl>
8980
     *  <dt><b>Scheduler:</b></dt>
8981
     *  <dd>{@code takeUntil} does not operate by default on a particular {@link Scheduler}.</dd>
8982
     * </dl>
8983
     * 
8984
     * @param other
8985
     *            the Observable whose first emitted item will cause {@code takeUntil} to stop emitting items
8986
     *            from the source Observable
8987
     * @param <E>
8988
     *            the type of items emitted by {@code other}
8989
     * @return an Observable that emits the items emitted by the source Observable until such time as {@code other} emits its first item
8990
     * @see <a href="http://reactivex.io/documentation/operators/takeuntil.html">ReactiveX operators documentation: TakeUntil</a>
8991
     */
8992
    public final <E> Observable<T> takeUntil(Observable<? extends E> other) {
8993 1 1. takeUntil : mutated return of Object value for rx/Observable::takeUntil to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTakeUntil<T, E>(other));
8994
    }
8995
8996
    /**
8997
     * Returns an Observable that emits items emitted by the source Observable so long as each item satisfied a
8998
     * specified condition, and then completes as soon as this condition is not satisfied.
8999
     * <p>
9000
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeWhile.png" alt="">
9001
     * <dl>
9002
     *  <dt><b>Scheduler:</b></dt>
9003
     *  <dd>{@code takeWhile} does not operate by default on a particular {@link Scheduler}.</dd>
9004
     * </dl>
9005
     * 
9006
     * @param predicate
9007
     *            a function that evaluates an item emitted by the source Observable and returns a Boolean
9008
     * @return an Observable that emits the items from the source Observable so long as each item satisfies the
9009
     *         condition defined by {@code predicate}, then completes
9010
     * @see <a href="http://reactivex.io/documentation/operators/takewhile.html">ReactiveX operators documentation: TakeWhile</a>
9011
     * @see Observable#takeUntil(Func1)
9012
     */
9013
    public final Observable<T> takeWhile(final Func1<? super T, Boolean> predicate) {
9014 1 1. takeWhile : mutated return of Object value for rx/Observable::takeWhile to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTakeWhile<T>(predicate));
9015
    }
9016
9017
    /**
9018
     * Returns an Observable that emits items emitted by the source Observable, checks the specified predicate
9019
     * for each item, and then completes if the condition is satisfied.
9020
     * <p>
9021
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/takeUntil.p.png" alt="">
9022
     * <p>
9023
     * The difference between this operator and {@link #takeWhile(Func1)} is that here, the condition is
9024
     * evaluated <em>after</em> the item is emitted.
9025
     * 
9026
     * @warn "Scheduler" and "Backpressure Support" sections missing from javadocs
9027
     * @param stopPredicate 
9028
     *            a function that evaluates an item emitted by the source Observable and returns a Boolean
9029
     * @return an Observable that first emits items emitted by the source Observable, checks the specified
9030
     *         condition after each item, and then completes if the condition is satisfied.
9031
     * @see <a href="http://reactivex.io/documentation/operators/takeuntil.html">ReactiveX operators documentation: TakeUntil</a>
9032
     * @see Observable#takeWhile(Func1)
9033
     * @since 1.1.0
9034
     */
9035
    public final Observable<T> takeUntil(final Func1<? super T, Boolean> stopPredicate) {
9036 1 1. takeUntil : mutated return of Object value for rx/Observable::takeUntil to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTakeUntilPredicate<T>(stopPredicate));
9037
    }
9038
    
9039
    /**
9040
     * Returns an Observable that emits only the first item emitted by the source Observable during sequential
9041
     * time windows of a specified duration.
9042
     * <p>
9043
     * This differs from {@link #throttleLast} in that this only tracks passage of time whereas
9044
     * {@link #throttleLast} ticks at scheduled intervals.
9045
     * <p>
9046
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/throttleFirst.png" alt="">
9047
     * <dl>
9048
     *  <dt><b>Backpressure Support:</b></dt>
9049
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
9050
     *  <dt><b>Scheduler:</b></dt>
9051
     *  <dd>{@code throttleFirst} operates by default on the {@code computation} {@link Scheduler}.</dd>
9052
     * </dl>
9053
     * 
9054
     * @param windowDuration
9055
     *            time to wait before emitting another item after emitting the last item
9056
     * @param unit
9057
     *            the unit of time of {@code windowDuration}
9058
     * @return an Observable that performs the throttle operation
9059
     * @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
9060
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
9061
     */
9062
    public final Observable<T> throttleFirst(long windowDuration, TimeUnit unit) {
9063 1 1. throttleFirst : mutated return of Object value for rx/Observable::throttleFirst to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return throttleFirst(windowDuration, unit, Schedulers.computation());
9064
    }
9065
9066
    /**
9067
     * Returns an Observable that emits only the first item emitted by the source Observable during sequential
9068
     * time windows of a specified duration, where the windows are managed by a specified Scheduler.
9069
     * <p>
9070
     * This differs from {@link #throttleLast} in that this only tracks passage of time whereas
9071
     * {@link #throttleLast} ticks at scheduled intervals.
9072
     * <p>
9073
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/throttleFirst.s.png" alt="">
9074
     * <dl>
9075
     *  <dt><b>Backpressure Support:</b></dt>
9076
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
9077
     *  <dt><b>Scheduler:</b></dt>
9078
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9079
     * </dl>
9080
     * 
9081
     * @param skipDuration
9082
     *            time to wait before emitting another item after emitting the last item
9083
     * @param unit
9084
     *            the unit of time of {@code skipDuration}
9085
     * @param scheduler
9086
     *            the {@link Scheduler} to use internally to manage the timers that handle timeout for each
9087
     *            event
9088
     * @return an Observable that performs the throttle operation
9089
     * @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
9090
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
9091
     */
9092
    public final Observable<T> throttleFirst(long skipDuration, TimeUnit unit, Scheduler scheduler) {
9093 1 1. throttleFirst : mutated return of Object value for rx/Observable::throttleFirst to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorThrottleFirst<T>(skipDuration, unit, scheduler));
9094
    }
9095
9096
    /**
9097
     * Returns an Observable that emits only the last item emitted by the source Observable during sequential
9098
     * time windows of a specified duration.
9099
     * <p>
9100
     * This differs from {@link #throttleFirst} in that this ticks along at a scheduled interval whereas
9101
     * {@link #throttleFirst} does not tick, it just tracks passage of time.
9102
     * <p>
9103
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/throttleLast.png" alt="">
9104
     * <dl>
9105
     *  <dt><b>Backpressure Support:</b></dt>
9106
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
9107
     *  <dt><b>Scheduler:</b></dt>
9108
     *  <dd>{@code throttleLast} operates by default on the {@code computation} {@link Scheduler}.</dd>
9109
     * </dl>
9110
     * 
9111
     * @param intervalDuration
9112
     *            duration of windows within which the last item emitted by the source Observable will be
9113
     *            emitted
9114
     * @param unit
9115
     *            the unit of time of {@code intervalDuration}
9116
     * @return an Observable that performs the throttle operation
9117
     * @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
9118
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
9119
     * @see #sample(long, TimeUnit)
9120
     */
9121
    public final Observable<T> throttleLast(long intervalDuration, TimeUnit unit) {
9122 1 1. throttleLast : mutated return of Object value for rx/Observable::throttleLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return sample(intervalDuration, unit);
9123
    }
9124
9125
    /**
9126
     * Returns an Observable that emits only the last item emitted by the source Observable during sequential
9127
     * time windows of a specified duration, where the duration is governed by a specified Scheduler.
9128
     * <p>
9129
     * This differs from {@link #throttleFirst} in that this ticks along at a scheduled interval whereas
9130
     * {@link #throttleFirst} does not tick, it just tracks passage of time.
9131
     * <p>
9132
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/throttleLast.s.png" alt="">
9133
     * <dl>
9134
     *  <dt><b>Backpressure Support:</b></dt>
9135
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
9136
     *  <dt><b>Scheduler:</b></dt>
9137
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9138
     * </dl>
9139
     * 
9140
     * @param intervalDuration
9141
     *            duration of windows within which the last item emitted by the source Observable will be
9142
     *            emitted
9143
     * @param unit
9144
     *            the unit of time of {@code intervalDuration}
9145
     * @param scheduler
9146
     *            the {@link Scheduler} to use internally to manage the timers that handle timeout for each
9147
     *            event
9148
     * @return an Observable that performs the throttle operation
9149
     * @see <a href="http://reactivex.io/documentation/operators/sample.html">ReactiveX operators documentation: Sample</a>
9150
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
9151
     * @see #sample(long, TimeUnit, Scheduler)
9152
     */
9153
    public final Observable<T> throttleLast(long intervalDuration, TimeUnit unit, Scheduler scheduler) {
9154 1 1. throttleLast : mutated return of Object value for rx/Observable::throttleLast to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return sample(intervalDuration, unit, scheduler);
9155
    }
9156
9157
    /**
9158
     * Returns an Observable that only emits those items emitted by the source Observable that are not followed
9159
     * by another emitted item within a specified time window.
9160
     * <p>
9161
     * <em>Note:</em> If the source Observable keeps emitting items more frequently than the length of the time
9162
     * window then no items will be emitted by the resulting Observable.
9163
     * <p>
9164
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/throttleWithTimeout.png" alt="">
9165
     * <p>
9166
     * Information on debounce vs throttle:
9167
     * <p>
9168
     * <ul>
9169
     * <li><a href="http://drupalmotion.com/article/debounce-and-throttle-visual-explanation">Debounce and Throttle: visual explanation</a></li>
9170
     * <li><a href="http://unscriptable.com/2009/03/20/debouncing-javascript-methods/">Debouncing: javascript methods</a></li>
9171
     * <li><a href="http://www.illyriad.co.uk/blog/index.php/2011/09/javascript-dont-spam-your-server-debounce-and-throttle/">Javascript - don't spam your server: debounce and throttle</a></li>
9172
     * </ul>
9173
     * <dl>
9174
     *  <dt><b>Backpressure Support:</b></dt>
9175
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
9176
     *  <dt><b>Scheduler:</b></dt>
9177
     *  <dd>{@code throttleWithTimeout} operates by default on the {@code computation} {@link Scheduler}.</dd>
9178
     * </dl>
9179
     * 
9180
     * @param timeout
9181
     *            the length of the window of time that must pass after the emission of an item from the source
9182
     *            Observable in which that Observable emits no items in order for the item to be emitted by the
9183
     *            resulting Observable
9184
     * @param unit
9185
     *            the {@link TimeUnit} of {@code timeout}
9186
     * @return an Observable that filters out items that are too quickly followed by newer items
9187
     * @see <a href="http://reactivex.io/documentation/operators/debounce.html">ReactiveX operators documentation: Debounce</a>
9188
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
9189
     * @see #debounce(long, TimeUnit)
9190
     */
9191
    public final Observable<T> throttleWithTimeout(long timeout, TimeUnit unit) {
9192 1 1. throttleWithTimeout : mutated return of Object value for rx/Observable::throttleWithTimeout to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return debounce(timeout, unit);
9193
    }
9194
9195
    /**
9196
     * Returns an Observable that only emits those items emitted by the source Observable that are not followed
9197
     * by another emitted item within a specified time window, where the time window is governed by a specified
9198
     * Scheduler.
9199
     * <p>
9200
     * <em>Note:</em> If the source Observable keeps emitting items more frequently than the length of the time
9201
     * window then no items will be emitted by the resulting Observable.
9202
     * <p>
9203
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/throttleWithTimeout.s.png" alt="">
9204
     * <p>
9205
     * Information on debounce vs throttle:
9206
     * <p>
9207
     * <ul>
9208
     * <li><a href="http://drupalmotion.com/article/debounce-and-throttle-visual-explanation">Debounce and Throttle: visual explanation</a></li>
9209
     * <li><a href="http://unscriptable.com/2009/03/20/debouncing-javascript-methods/">Debouncing: javascript methods</a></li>
9210
     * <li><a href="http://www.illyriad.co.uk/blog/index.php/2011/09/javascript-dont-spam-your-server-debounce-and-throttle/">Javascript - don't spam your server: debounce and throttle</a></li>
9211
     * </ul>
9212
     * <dl>
9213
     *  <dt><b>Backpressure Support:</b></dt>
9214
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
9215
     *  <dt><b>Scheduler:</b></dt>
9216
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9217
     * </dl>
9218
     * 
9219
     * @param timeout
9220
     *            the length of the window of time that must pass after the emission of an item from the source
9221
     *            Observable in which that Observable emits no items in order for the item to be emitted by the
9222
     *            resulting Observable
9223
     * @param unit
9224
     *            the {@link TimeUnit} of {@code timeout}
9225
     * @param scheduler
9226
     *            the {@link Scheduler} to use internally to manage the timers that handle the timeout for each
9227
     *            item
9228
     * @return an Observable that filters out items that are too quickly followed by newer items
9229
     * @see <a href="http://reactivex.io/documentation/operators/debounce.html">ReactiveX operators documentation: Debounce</a>
9230
     * @see <a href="https://github.com/ReactiveX/RxJava/wiki/Backpressure">RxJava wiki: Backpressure</a>
9231
     * @see #debounce(long, TimeUnit, Scheduler)
9232
     */
9233
    public final Observable<T> throttleWithTimeout(long timeout, TimeUnit unit, Scheduler scheduler) {
9234 1 1. throttleWithTimeout : mutated return of Object value for rx/Observable::throttleWithTimeout to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return debounce(timeout, unit, scheduler);
9235
    }
9236
9237
    /**
9238
     * Returns an Observable that emits records of the time interval between consecutive items emitted by the
9239
     * source Observable.
9240
     * <p>
9241
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeInterval.png" alt="">
9242
     * <dl>
9243
     *  <dt><b>Scheduler:</b></dt>
9244
     *  <dd>{@code timeInterval} operates by default on the {@code immediate} {@link Scheduler}.</dd>
9245
     * </dl>
9246
     * 
9247
     * @return an Observable that emits time interval information items
9248
     * @see <a href="http://reactivex.io/documentation/operators/timeinterval.html">ReactiveX operators documentation: TimeInterval</a>
9249
     */
9250
    public final Observable<TimeInterval<T>> timeInterval() {
9251 1 1. timeInterval : mutated return of Object value for rx/Observable::timeInterval to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return timeInterval(Schedulers.immediate());
9252
    }
9253
9254
    /**
9255
     * Returns an Observable that emits records of the time interval between consecutive items emitted by the
9256
     * source Observable, where this interval is computed on a specified Scheduler.
9257
     * <p>
9258
     * <img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeInterval.s.png" alt="">
9259
     * <dl>
9260
     *  <dt><b>Scheduler:</b></dt>
9261
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9262
     * </dl>
9263
     * 
9264
     * @param scheduler
9265
     *            the {@link Scheduler} used to compute time intervals
9266
     * @return an Observable that emits time interval information items
9267
     * @see <a href="http://reactivex.io/documentation/operators/timeinterval.html">ReactiveX operators documentation: TimeInterval</a>
9268
     */
9269
    public final Observable<TimeInterval<T>> timeInterval(Scheduler scheduler) {
9270 1 1. timeInterval : mutated return of Object value for rx/Observable::timeInterval to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTimeInterval<T>(scheduler));
9271
    }
9272
9273
    /**
9274
     * Returns an Observable that mirrors the source Observable, but notifies observers of a
9275
     * {@code TimeoutException} if either the first item emitted by the source Observable or any subsequent item
9276
     * doesn't arrive within time windows defined by other Observables.
9277
     * <p>
9278
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout5.png" alt="">
9279
     * <dl>
9280
     *  <dt><b>Scheduler:</b></dt>
9281
     *  <dd>This version of {@code timeout} operates by default on the {@code immediate} {@link Scheduler}.</dd>
9282
     * </dl>
9283
     * 
9284
     * @param <U>
9285
     *            the first timeout value type (ignored)
9286
     * @param <V>
9287
     *            the subsequent timeout value type (ignored)
9288
     * @param firstTimeoutSelector
9289
     *            a function that returns an Observable that determines the timeout window for the first source
9290
     *            item
9291
     * @param timeoutSelector
9292
     *            a function that returns an Observable for each item emitted by the source Observable and that
9293
     *            determines the timeout window in which the subsequent source item must arrive in order to
9294
     *            continue the sequence
9295
     * @return an Observable that mirrors the source Observable, but notifies observers of a
9296
     *         {@code TimeoutException} if either the first item or any subsequent item doesn't arrive within
9297
     *         the time windows specified by the timeout selectors
9298
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9299
     */
9300
    public final <U, V> Observable<T> timeout(Func0<? extends Observable<U>> firstTimeoutSelector, Func1<? super T, ? extends Observable<V>> timeoutSelector) {
9301 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return timeout(firstTimeoutSelector, timeoutSelector, null);
9302
    }
9303
9304
    /**
9305
     * Returns an Observable that mirrors the source Observable, but switches to a fallback Observable if either
9306
     * the first item emitted by the source Observable or any subsequent item doesn't arrive within time windows
9307
     * defined by other Observables.
9308
     * <p>
9309
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout6.png" alt="">
9310
     * <dl>
9311
     *  <dt><b>Scheduler:</b></dt>
9312
     *  <dd>This version of {@code timeout} operates by default on the {@code immediate} {@link Scheduler}.</dd>
9313
     * </dl>
9314
     * 
9315
     * @param <U>
9316
     *            the first timeout value type (ignored)
9317
     * @param <V>
9318
     *            the subsequent timeout value type (ignored)
9319
     * @param firstTimeoutSelector
9320
     *            a function that returns an Observable which determines the timeout window for the first source
9321
     *            item
9322
     * @param timeoutSelector
9323
     *            a function that returns an Observable for each item emitted by the source Observable and that
9324
     *            determines the timeout window in which the subsequent source item must arrive in order to
9325
     *            continue the sequence
9326
     * @param other
9327
     *            the fallback Observable to switch to if the source Observable times out
9328
     * @return an Observable that mirrors the source Observable, but switches to the {@code other} Observable if
9329
     *         either the first item emitted by the source Observable or any subsequent item doesn't arrive
9330
     *         within time windows defined by the timeout selectors
9331
     * @throws NullPointerException
9332
     *             if {@code timeoutSelector} is null
9333
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9334
     */
9335
    public final <U, V> Observable<T> timeout(Func0<? extends Observable<U>> firstTimeoutSelector, Func1<? super T, ? extends Observable<V>> timeoutSelector, Observable<? extends T> other) {
9336 1 1. timeout : negated conditional → KILLED
        if (timeoutSelector == null) {
9337
            throw new NullPointerException("timeoutSelector is null");
9338
        }
9339 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTimeoutWithSelector<T, U, V>(firstTimeoutSelector, timeoutSelector, other));
9340
    }
9341
9342
    /**
9343
     * Returns an Observable that mirrors the source Observable, but notifies observers of a
9344
     * {@code TimeoutException} if an item emitted by the source Observable doesn't arrive within a window of
9345
     * time after the emission of the previous item, where that period of time is measured by an Observable that
9346
     * is a function of the previous item.
9347
     * <p>
9348
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout3.png" alt="">
9349
     * <p>
9350
     * Note: The arrival of the first source item is never timed out.
9351
     * <dl>
9352
     *  <dt><b>Scheduler:</b></dt>
9353
     *  <dd>This version of {@code timeout} operates by default on the {@code immediate} {@link Scheduler}.</dd>
9354
     * </dl>
9355
     * 
9356
     * @param <V>
9357
     *            the timeout value type (ignored)
9358
     * @param timeoutSelector
9359
     *            a function that returns an observable for each item emitted by the source
9360
     *            Observable and that determines the timeout window for the subsequent item
9361
     * @return an Observable that mirrors the source Observable, but notifies observers of a
9362
     *         {@code TimeoutException} if an item emitted by the source Observable takes longer to arrive than
9363
     *         the time window defined by the selector for the previously emitted item
9364
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9365
     */
9366
    public final <V> Observable<T> timeout(Func1<? super T, ? extends Observable<V>> timeoutSelector) {
9367 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return timeout(null, timeoutSelector, null);
9368
    }
9369
9370
    /**
9371
     * Returns an Observable that mirrors the source Observable, but that switches to a fallback Observable if
9372
     * an item emitted by the source Observable doesn't arrive within a window of time after the emission of the
9373
     * previous item, where that period of time is measured by an Observable that is a function of the previous
9374
     * item.
9375
     * <p>
9376
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout4.png" alt="">
9377
     * <p>
9378
     * Note: The arrival of the first source item is never timed out.
9379
     * <dl>
9380
     *  <dt><b>Scheduler:</b></dt>
9381
     *  <dd>This version of {@code timeout} operates by default on the {@code immediate} {@link Scheduler}.</dd>
9382
     * </dl>
9383
     * 
9384
     * @param <V>
9385
     *            the timeout value type (ignored)
9386
     * @param timeoutSelector
9387
     *            a function that returns an Observable, for each item emitted by the source Observable, that
9388
     *            determines the timeout window for the subsequent item
9389
     * @param other
9390
     *            the fallback Observable to switch to if the source Observable times out
9391
     * @return an Observable that mirrors the source Observable, but switches to mirroring a fallback Observable
9392
     *         if an item emitted by the source Observable takes longer to arrive than the time window defined
9393
     *         by the selector for the previously emitted item
9394
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9395
     */
9396
    public final <V> Observable<T> timeout(Func1<? super T, ? extends Observable<V>> timeoutSelector, Observable<? extends T> other) {
9397 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → TIMED_OUT
        return timeout(null, timeoutSelector, other);
9398
    }
9399
9400
    /**
9401
     * Returns an Observable that mirrors the source Observable but applies a timeout policy for each emitted
9402
     * item. If the next item isn't emitted within the specified timeout duration starting from its predecessor,
9403
     * the resulting Observable terminates and notifies observers of a {@code TimeoutException}.
9404
     * <p>
9405
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout.1.png" alt="">
9406
     * <dl>
9407
     *  <dt><b>Scheduler:</b></dt>
9408
     *  <dd>This version of {@code timeout} operates by default on the {@code computation} {@link Scheduler}.</dd>
9409
     * </dl>
9410
     * 
9411
     * @param timeout
9412
     *            maximum duration between emitted items before a timeout occurs
9413
     * @param timeUnit
9414
     *            the unit of time that applies to the {@code timeout} argument.
9415
     * @return the source Observable modified to notify observers of a {@code TimeoutException} in case of a
9416
     *         timeout
9417
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9418
     */
9419
    public final Observable<T> timeout(long timeout, TimeUnit timeUnit) {
9420 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return timeout(timeout, timeUnit, null, Schedulers.computation());
9421
    }
9422
9423
    /**
9424
     * Returns an Observable that mirrors the source Observable but applies a timeout policy for each emitted
9425
     * item. If the next item isn't emitted within the specified timeout duration starting from its predecessor,
9426
     * the resulting Observable begins instead to mirror a fallback Observable.
9427
     * <p>
9428
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout.2.png" alt="">
9429
     * <dl>
9430
     *  <dt><b>Scheduler:</b></dt>
9431
     *  <dd>This version of {@code timeout} operates by default on the {@code computation} {@link Scheduler}.</dd>
9432
     * </dl>
9433
     * 
9434
     * @param timeout
9435
     *            maximum duration between items before a timeout occurs
9436
     * @param timeUnit
9437
     *            the unit of time that applies to the {@code timeout} argument
9438
     * @param other
9439
     *            the fallback Observable to use in case of a timeout
9440
     * @return the source Observable modified to switch to the fallback Observable in case of a timeout
9441
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9442
     */
9443
    public final Observable<T> timeout(long timeout, TimeUnit timeUnit, Observable<? extends T> other) {
9444 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return timeout(timeout, timeUnit, other, Schedulers.computation());
9445
    }
9446
9447
    /**
9448
     * Returns an Observable that mirrors the source Observable but applies a timeout policy for each emitted
9449
     * item using a specified Scheduler. If the next item isn't emitted within the specified timeout duration
9450
     * starting from its predecessor, the resulting Observable begins instead to mirror a fallback Observable.
9451
     * <p>
9452
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout.2s.png" alt="">
9453
     * <dl>
9454
     *  <dt><b>Scheduler:</b></dt>
9455
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9456
     * </dl>
9457
     * 
9458
     * @param timeout
9459
     *            maximum duration between items before a timeout occurs
9460
     * @param timeUnit
9461
     *            the unit of time that applies to the {@code timeout} argument
9462
     * @param other
9463
     *            the Observable to use as the fallback in case of a timeout
9464
     * @param scheduler
9465
     *            the {@link Scheduler} to run the timeout timers on
9466
     * @return the source Observable modified so that it will switch to the fallback Observable in case of a
9467
     *         timeout
9468
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9469
     */
9470
    public final Observable<T> timeout(long timeout, TimeUnit timeUnit, Observable<? extends T> other, Scheduler scheduler) {
9471 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTimeout<T>(timeout, timeUnit, other, scheduler));
9472
    }
9473
9474
    /**
9475
     * Returns an Observable that mirrors the source Observable but applies a timeout policy for each emitted
9476
     * item, where this policy is governed on a specified Scheduler. If the next item isn't emitted within the
9477
     * specified timeout duration starting from its predecessor, the resulting Observable terminates and
9478
     * notifies observers of a {@code TimeoutException}.
9479
     * <p>
9480
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timeout.1s.png" alt="">
9481
     * <dl>
9482
     *  <dt><b>Scheduler:</b></dt>
9483
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9484
     * </dl>
9485
     * 
9486
     * @param timeout
9487
     *            maximum duration between items before a timeout occurs
9488
     * @param timeUnit
9489
     *            the unit of time that applies to the {@code timeout} argument
9490
     * @param scheduler
9491
     *            the Scheduler to run the timeout timers on
9492
     * @return the source Observable modified to notify observers of a {@code TimeoutException} in case of a
9493
     *         timeout
9494
     * @see <a href="http://reactivex.io/documentation/operators/timeout.html">ReactiveX operators documentation: Timeout</a>
9495
     */
9496
    public final Observable<T> timeout(long timeout, TimeUnit timeUnit, Scheduler scheduler) {
9497 1 1. timeout : mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return timeout(timeout, timeUnit, null, scheduler);
9498
    }
9499
9500
    /**
9501
     * Returns an Observable that emits each item emitted by the source Observable, wrapped in a
9502
     * {@link Timestamped} object.
9503
     * <p>
9504
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timestamp.png" alt="">
9505
     * <dl>
9506
     *  <dt><b>Scheduler:</b></dt>
9507
     *  <dd>{@code timestamp} operates by default on the {@code immediate} {@link Scheduler}.</dd>
9508
     * </dl>
9509
     * 
9510
     * @return an Observable that emits timestamped items from the source Observable
9511
     * @see <a href="http://reactivex.io/documentation/operators/timestamp.html">ReactiveX operators documentation: Timestamp</a>
9512
     */
9513
    public final Observable<Timestamped<T>> timestamp() {
9514 1 1. timestamp : mutated return of Object value for rx/Observable::timestamp to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return timestamp(Schedulers.immediate());
9515
    }
9516
9517
    /**
9518
     * Returns an Observable that emits each item emitted by the source Observable, wrapped in a
9519
     * {@link Timestamped} object whose timestamps are provided by a specified Scheduler.
9520
     * <p>
9521
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/timestamp.s.png" alt="">
9522
     * <dl>
9523
     *  <dt><b>Scheduler:</b></dt>
9524
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9525
     * </dl>
9526
     * 
9527
     * @param scheduler
9528
     *            the {@link Scheduler} to use as a time source
9529
     * @return an Observable that emits timestamped items from the source Observable with timestamps provided by
9530
     *         the {@code scheduler}
9531
     * @see <a href="http://reactivex.io/documentation/operators/timestamp.html">ReactiveX operators documentation: Timestamp</a>
9532
     */
9533
    public final Observable<Timestamped<T>> timestamp(Scheduler scheduler) {
9534 1 1. timestamp : mutated return of Object value for rx/Observable::timestamp to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorTimestamp<T>(scheduler));
9535
    }
9536
9537
    /**
9538
     * Converts an Observable into a {@link BlockingObservable} (an Observable with blocking operators).
9539
     * <dl>
9540
     *  <dt><b>Scheduler:</b></dt>
9541
     *  <dd>{@code toBlocking} does not operate by default on a particular {@link Scheduler}.</dd>
9542
     * </dl>
9543
     *
9544
     * @return a {@code BlockingObservable} version of this Observable
9545
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9546
     */
9547
    public final BlockingObservable<T> toBlocking() {
9548 1 1. toBlocking : mutated return of Object value for rx/Observable::toBlocking to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return BlockingObservable.from(this);
9549
    }
9550
9551
    /**
9552
     * Returns an Observable that emits a single item, a list composed of all the items emitted by the source
9553
     * Observable.
9554
     * <p>
9555
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toList.png" alt="">
9556
     * <p>
9557
     * Normally, an Observable that returns multiple items will do so by invoking its {@link Observer}'s
9558
     * {@link Observer#onNext onNext} method for each such item. You can change this behavior, instructing the
9559
     * Observable to compose a list of all of these items and then to invoke the Observer's {@code onNext}
9560
     * function once, passing it the entire list, by calling the Observable's {@code toList} method prior to
9561
     * calling its {@link #subscribe} method.
9562
     * <p>
9563
     * Be careful not to use this operator on Observables that emit infinite or very large numbers of items, as
9564
     * you do not have the option to unsubscribe.
9565
     * <dl>
9566
     *  <dt><b>Backpressure Support:</b></dt>
9567
     *  <dd>The operator buffers everything from its upstream but it only emits the aggregated list when the downstream requests at least one item.</dd>
9568
     *  <dt><b>Scheduler:</b></dt>
9569
     *  <dd>{@code toList} does not operate by default on a particular {@link Scheduler}.</dd>
9570
     * </dl>
9571
     * 
9572
     * @return an Observable that emits a single item: a List containing all of the items emitted by the source
9573
     *         Observable
9574
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9575
     */
9576
    public final Observable<List<T>> toList() {
9577 1 1. toList : mutated return of Object value for rx/Observable::toList to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(OperatorToObservableList.<T>instance());
9578
    }
9579
9580
    /**
9581
     * Returns an Observable that emits a single HashMap containing all items emitted by the source Observable,
9582
     * mapped by the keys returned by a specified {@code keySelector} function.
9583
     * <p>
9584
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMap.png" alt="">
9585
     * <p>
9586
     * If more than one source item maps to the same key, the HashMap will contain the latest of those items.
9587
     * <dl>
9588
     *  <dt><b>Backpressure Support:</b></dt>
9589
     *  <dd>This operator does not support backpressure as by intent it is requesting and buffering everything.</dd>
9590
     *  <dt><b>Scheduler:</b></dt>
9591
     *  <dd>{@code toMap} does not operate by default on a particular {@link Scheduler}.</dd>
9592
     * </dl>
9593
     * 
9594
     * @param keySelector
9595
     *            the function that extracts the key from a source item to be used in the HashMap
9596
     * @return an Observable that emits a single item: a HashMap containing the mapped items from the source
9597
     *         Observable
9598
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9599
     */
9600
    public final <K> Observable<Map<K, T>> toMap(Func1<? super T, ? extends K> keySelector) {
9601 1 1. toMap : mutated return of Object value for rx/Observable::toMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToMap<T, K, T>(keySelector, UtilityFunctions.<T>identity()));
9602
    }
9603
9604
    /**
9605
     * Returns an Observable that emits a single HashMap containing values corresponding to items emitted by the
9606
     * source Observable, mapped by the keys returned by a specified {@code keySelector} function.
9607
     * <p>
9608
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMap.png" alt="">
9609
     * <p>
9610
     * If more than one source item maps to the same key, the HashMap will contain a single entry that
9611
     * corresponds to the latest of those items.
9612
     * <dl>
9613
     *  <dt><b>Backpressure Support:</b></dt>
9614
     *  <dd>This operator does not support backpressure as by intent it is requesting and buffering everything.</dd>
9615
     *  <dt><b>Scheduler:</b></dt>
9616
     *  <dd>{@code toMap} does not operate by default on a particular {@link Scheduler}.</dd>
9617
     * </dl>
9618
     * 
9619
     * @param keySelector
9620
     *            the function that extracts the key from a source item to be used in the HashMap
9621
     * @param valueSelector
9622
     *            the function that extracts the value from a source item to be used in the HashMap
9623
     * @return an Observable that emits a single item: a HashMap containing the mapped items from the source
9624
     *         Observable
9625
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9626
     */
9627
    public final <K, V> Observable<Map<K, V>> toMap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) {
9628 1 1. toMap : mutated return of Object value for rx/Observable::toMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToMap<T, K, V>(keySelector, valueSelector));
9629
    }
9630
9631
    /**
9632
     * Returns an Observable that emits a single Map, returned by a specified {@code mapFactory} function, that
9633
     * contains keys and values extracted from the items emitted by the source Observable.
9634
     * <p>
9635
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMap.png" alt="">
9636
     * <dl>
9637
     *  <dt><b>Backpressure Support:</b></dt>
9638
     *  <dd>This operator does not support backpressure as by intent it is requesting and buffering everything.</dd>
9639
     *  <dt><b>Scheduler:</b></dt>
9640
     *  <dd>{@code toMap} does not operate by default on a particular {@link Scheduler}.</dd>
9641
     * </dl>
9642
     * 
9643
     * @param keySelector
9644
     *            the function that extracts the key from a source item to be used in the Map
9645
     * @param valueSelector
9646
     *            the function that extracts the value from the source items to be used as value in the Map
9647
     * @param mapFactory
9648
     *            the function that returns a Map instance to be used
9649
     * @return an Observable that emits a single item: a Map that contains the mapped items emitted by the
9650
     *         source Observable
9651
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9652
     */
9653
    public final <K, V> Observable<Map<K, V>> toMap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func0<? extends Map<K, V>> mapFactory) {
9654 1 1. toMap : mutated return of Object value for rx/Observable::toMap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToMap<T, K, V>(keySelector, valueSelector, mapFactory));
9655
    }
9656
9657
    /**
9658
     * Returns an Observable that emits a single HashMap that contains an ArrayList of items emitted by the
9659
     * source Observable keyed by a specified {@code keySelector} function.
9660
     * <p>
9661
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMultiMap.png" alt="">
9662
     * <dl>
9663
     *  <dt><b>Backpressure Support:</b></dt>
9664
     *  <dd>This operator does not support backpressure as by intent it is requesting and buffering everything.</dd>
9665
     *  <dt><b>Scheduler:</b></dt>
9666
     *  <dd>{@code toMultiMap} does not operate by default on a particular {@link Scheduler}.</dd>
9667
     * </dl>
9668
     * 
9669
     * @param keySelector
9670
     *            the function that extracts the key from the source items to be used as key in the HashMap
9671
     * @return an Observable that emits a single item: a HashMap that contains an ArrayList of items mapped from
9672
     *         the source Observable
9673
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9674
     */
9675
    public final <K> Observable<Map<K, Collection<T>>> toMultimap(Func1<? super T, ? extends K> keySelector) {
9676 1 1. toMultimap : mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToMultimap<T, K, T>(keySelector, UtilityFunctions.<T>identity()));
9677
    }
9678
9679
    /**
9680
     * Returns an Observable that emits a single HashMap that contains an ArrayList of values extracted by a
9681
     * specified {@code valueSelector} function from items emitted by the source Observable, keyed by a
9682
     * specified {@code keySelector} function.
9683
     * <p>
9684
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMultiMap.png" alt="">
9685
     * <dl>
9686
     *  <dt><b>Backpressure Support:</b></dt>
9687
     *  <dd>This operator does not support backpressure as by intent it is requesting and buffering everything.</dd>
9688
     *  <dt><b>Scheduler:</b></dt>
9689
     *  <dd>{@code toMultiMap} does not operate by default on a particular {@link Scheduler}.</dd>
9690
     * </dl>
9691
     * 
9692
     * @param keySelector
9693
     *            the function that extracts a key from the source items to be used as key in the HashMap
9694
     * @param valueSelector
9695
     *            the function that extracts a value from the source items to be used as value in the HashMap
9696
     * @return an Observable that emits a single item: a HashMap that contains an ArrayList of items mapped from
9697
     *         the source Observable
9698
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9699
     */
9700
    public final <K, V> Observable<Map<K, Collection<V>>> toMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector) {
9701 1 1. toMultimap : mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToMultimap<T, K, V>(keySelector, valueSelector));
9702
    }
9703
9704
    /**
9705
     * Returns an Observable that emits a single Map, returned by a specified {@code mapFactory} function, that
9706
     * contains an ArrayList of values, extracted by a specified {@code valueSelector} function from items
9707
     * emitted by the source Observable and keyed by the {@code keySelector} function.
9708
     * <p>
9709
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMultiMap.png" alt="">
9710
     * <dl>
9711
     *  <dt><b>Backpressure Support:</b></dt>
9712
     *  <dd>This operator does not support backpressure as by intent it is requesting and buffering everything.</dd>
9713
     *  <dt><b>Scheduler:</b></dt>
9714
     *  <dd>{@code toMultiMap} does not operate by default on a particular {@link Scheduler}.</dd>
9715
     * </dl>
9716
     * 
9717
     * @param keySelector
9718
     *            the function that extracts a key from the source items to be used as the key in the Map
9719
     * @param valueSelector
9720
     *            the function that extracts a value from the source items to be used as the value in the Map
9721
     * @param mapFactory
9722
     *            the function that returns a Map instance to be used
9723
     * @return an Observable that emits a single item: a Map that contains a list items mapped from the source
9724
     *         Observable
9725
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9726
     */
9727
    public final <K, V> Observable<Map<K, Collection<V>>> toMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func0<? extends Map<K, Collection<V>>> mapFactory) {
9728 1 1. toMultimap : mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToMultimap<T, K, V>(keySelector, valueSelector, mapFactory));
9729
    }
9730
9731
    /**
9732
     * Returns an Observable that emits a single Map, returned by a specified {@code mapFactory} function, that
9733
     * contains a custom collection of values, extracted by a specified {@code valueSelector} function from
9734
     * items emitted by the source Observable, and keyed by the {@code keySelector} function.
9735
     * <p>
9736
     * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toMultiMap.png" alt="">
9737
     * <dl>
9738
     *  <dt><b>Backpressure Support:</b></dt>
9739
     *  <dd>This operator does not support backpressure as by intent it is requesting and buffering everything.</dd>
9740
     *  <dt><b>Scheduler:</b></dt>
9741
     *  <dd>{@code toMultiMap} does not operate by default on a particular {@link Scheduler}.</dd>
9742
     * </dl>
9743
     * 
9744
     * @param keySelector
9745
     *            the function that extracts a key from the source items to be used as the key in the Map
9746
     * @param valueSelector
9747
     *            the function that extracts a value from the source items to be used as the value in the Map
9748
     * @param mapFactory
9749
     *            the function that returns a Map instance to be used
9750
     * @param collectionFactory
9751
     *            the function that returns a Collection instance for a particular key to be used in the Map
9752
     * @return an Observable that emits a single item: a Map that contains the collection of mapped items from
9753
     *         the source Observable
9754
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9755
     */
9756
    public final <K, V> Observable<Map<K, Collection<V>>> toMultimap(Func1<? super T, ? extends K> keySelector, Func1<? super T, ? extends V> valueSelector, Func0<? extends Map<K, Collection<V>>> mapFactory, Func1<? super K, ? extends Collection<V>> collectionFactory) {
9757 1 1. toMultimap : mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToMultimap<T, K, V>(keySelector, valueSelector, mapFactory, collectionFactory));
9758
    }
9759
9760
    /**
9761
     * Returns an Observable that emits a list that contains the items emitted by the source Observable, in a
9762
     * sorted order. Each item emitted by the Observable must implement {@link Comparable} with respect to all
9763
     * other items in the sequence.
9764
     * <p>
9765
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toSortedList.png" alt="">
9766
     * <dl>
9767
     *  <dt><b>Backpressure Support:</b></dt>
9768
     *  <dd>The operator buffers everything from its upstream but it only emits the sorted list when the downstream requests at least one item.</dd>
9769
     *  <dt><b>Scheduler:</b></dt>
9770
     *  <dd>{@code toSortedList} does not operate by default on a particular {@link Scheduler}.</dd>
9771
     * </dl>
9772
     * 
9773
     * @throws ClassCastException
9774
     *             if any item emitted by the Observable does not implement {@link Comparable} with respect to
9775
     *             all other items emitted by the Observable
9776
     * @return an Observable that emits a list that contains the items emitted by the source Observable in
9777
     *         sorted order
9778
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9779
     */
9780
    public final Observable<List<T>> toSortedList() {
9781 1 1. toSortedList : mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToObservableSortedList<T>(10));
9782
    }
9783
9784
    /**
9785
     * Returns an Observable that emits a list that contains the items emitted by the source Observable, in a
9786
     * sorted order based on a specified comparison function.
9787
     * <p>
9788
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toSortedList.f.png" alt="">
9789
     * <dl>
9790
     *  <dt><b>Backpressure Support:</b></dt>
9791
     *  <dd>The operator buffers everything from its upstream but it only emits the sorted list when the downstream requests at least one item.</dd>
9792
     *  <dt><b>Scheduler:</b></dt>
9793
     *  <dd>{@code toSortedList} does not operate by default on a particular {@link Scheduler}.</dd>
9794
     * </dl>
9795
     * 
9796
     * @param sortFunction
9797
     *            a function that compares two items emitted by the source Observable and returns an Integer
9798
     *            that indicates their sort order
9799
     * @return an Observable that emits a list that contains the items emitted by the source Observable in
9800
     *         sorted order
9801
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9802
     */
9803
    public final Observable<List<T>> toSortedList(Func2<? super T, ? super T, Integer> sortFunction) {
9804 1 1. toSortedList : mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorToObservableSortedList<T>(sortFunction, 10));
9805
    }
9806
9807
    /**
9808
     * Returns an Observable that emits a list that contains the items emitted by the source Observable, in a
9809
     * sorted order. Each item emitted by the Observable must implement {@link Comparable} with respect to all
9810
     * other items in the sequence.
9811
     * <p>
9812
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toSortedList.png" alt="">
9813
     * <dl>
9814
     *  <dt><b>Backpressure Support:</b></dt>
9815
     *  <dd>The operator buffers everything from its upstream but it only emits the sorted list when the downstream requests at least one item.</dd>
9816
     *  <dt><b>Scheduler:</b></dt>
9817
     *  <dd>{@code toSortedList} does not operate by default on a particular {@link Scheduler}.</dd>
9818
     * </dl>
9819
     * 
9820
     * @throws ClassCastException
9821
     *             if any item emitted by the Observable does not implement {@link Comparable} with respect to
9822
     *             all other items emitted by the Observable
9823
     * @param initialCapacity 
9824
     *             the initial capacity of the ArrayList used to accumulate items before sorting
9825
     * @return an Observable that emits a list that contains the items emitted by the source Observable in
9826
     *         sorted order
9827
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9828
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
9829
     */
9830
    @Experimental
9831
    public final Observable<List<T>> toSortedList(int initialCapacity) {
9832 1 1. toSortedList : mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return lift(new OperatorToObservableSortedList<T>(initialCapacity));
9833
    }
9834
9835
    /**
9836
     * Returns an Observable that emits a list that contains the items emitted by the source Observable, in a
9837
     * sorted order based on a specified comparison function.
9838
     * <p>
9839
     * <img width="640" height="310" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toSortedList.f.png" alt="">
9840
     * <dl>
9841
     *  <dt><b>Backpressure Support:</b></dt>
9842
     *  <dd>The operator buffers everything from its upstream but it only emits the sorted list when the downstream requests at least one item.</dd>
9843
     *  <dt><b>Scheduler:</b></dt>
9844
     *  <dd>{@code toSortedList} does not operate by default on a particular {@link Scheduler}.</dd>
9845
     * </dl>
9846
     * 
9847
     * @param sortFunction
9848
     *            a function that compares two items emitted by the source Observable and returns an Integer
9849
     *            that indicates their sort order
9850
     * @param initialCapacity 
9851
     *             the initial capacity of the ArrayList used to accumulate items before sorting
9852
     * @return an Observable that emits a list that contains the items emitted by the source Observable in
9853
     *         sorted order
9854
     * @see <a href="http://reactivex.io/documentation/operators/to.html">ReactiveX operators documentation: To</a>
9855
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
9856
     */
9857
    @Experimental
9858
    public final Observable<List<T>> toSortedList(Func2<? super T, ? super T, Integer> sortFunction, int initialCapacity) {
9859 1 1. toSortedList : mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return lift(new OperatorToObservableSortedList<T>(sortFunction, initialCapacity));
9860
    }
9861
9862
    /**
9863
     * Modifies the source Observable so that subscribers will unsubscribe from it on a specified
9864
     * {@link Scheduler}.
9865
     * <dl>
9866
     *  <dt><b>Scheduler:</b></dt>
9867
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
9868
     * </dl>
9869
     * 
9870
     * @param scheduler
9871
     *            the {@link Scheduler} to perform unsubscription actions on
9872
     * @return the source Observable modified so that its unsubscriptions happen on the specified
9873
     *         {@link Scheduler}
9874
     * @see <a href="http://reactivex.io/documentation/operators/subscribeon.html">ReactiveX operators documentation: SubscribeOn</a>
9875
     */
9876
    public final Observable<T> unsubscribeOn(Scheduler scheduler) {
9877 1 1. unsubscribeOn : mutated return of Object value for rx/Observable::unsubscribeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorUnsubscribeOn<T>(scheduler));
9878
    }
9879
9880
    /**
9881
     * Merges the specified Observable into this Observable sequence by using the {@code resultSelector}
9882
     * function only when the source Observable (this instance) emits an item.
9883
     * <p>
9884
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/withLatestFrom.png" alt="">
9885
     *
9886
     * @warn "Backpressure Support" section missing from javadoc
9887
     * @warn "Scheduler" section missing from javadoc
9888
     * @param other
9889
     *            the other Observable
9890
     * @param resultSelector
9891
     *            the function to call when this Observable emits an item and the other Observable has already
9892
     *            emitted an item, to generate the item to be emitted by the resulting Observable
9893
     * @return an Observable that merges the specified Observable into this Observable by using the
9894
     *         {@code resultSelector} function only when the source Observable sequence (this instance) emits an
9895
     *         item
9896
     * @Experimental The behavior of this can change at any time.
9897
     * @since (if this graduates from Experimental/Beta to supported, replace this parenthetical with the release number)
9898
     * @see <a href="http://reactivex.io/documentation/operators/combinelatest.html">ReactiveX operators documentation: CombineLatest</a>
9899
     */
9900
    @Experimental
9901
    public final <U, R> Observable<R> withLatestFrom(Observable<? extends U> other, Func2<? super T, ? super U, ? extends R> resultSelector) {
9902 1 1. withLatestFrom : mutated return of Object value for rx/Observable::withLatestFrom to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorWithLatestFrom<T, U, R>(other, resultSelector));
9903
    }
9904
    
9905
    /**
9906
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
9907
     * Observable emits connected, non-overlapping windows. It emits the current window and opens a new one
9908
     * whenever the Observable produced by the specified {@code closingSelector} emits an item.
9909
     * <p>
9910
     * <img width="640" height="460" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window1.png" alt="">
9911
     * <dl>
9912
     *  <dt><b>Backpressure Support:</b></dt>
9913
     *  <dd>This operator does not support backpressure as it uses the {@code closingSelector} to control data
9914
     *      flow.</dd>
9915
     *  <dt><b>Scheduler:</b></dt>
9916
     *  <dd>This version of {@code window} does not operate by default on a particular {@link Scheduler}.</dd>
9917
     * </dl>
9918
     * 
9919
     * @param closingSelector
9920
     *            a {@link Func0} that returns an {@code Observable} that governs the boundary between windows.
9921
     *            When this {@code Observable} emits an item, {@code window} emits the current window and begins
9922
     *            a new one.
9923
     * @return an Observable that emits connected, non-overlapping windows of items from the source Observable
9924
     *         whenever {@code closingSelector} emits an item
9925
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
9926
     */
9927
    public final <TClosing> Observable<Observable<T>> window(Func0<? extends Observable<? extends TClosing>> closingSelector) {
9928 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorWindowWithObservableFactory<T, TClosing>(closingSelector));
9929
    }
9930
9931
    /**
9932
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
9933
     * Observable emits connected, non-overlapping windows, each containing {@code count} items. When the source
9934
     * Observable completes or encounters an error, the resulting Observable emits the current window and
9935
     * propagates the notification from the source Observable.
9936
     * <p>
9937
     * <img width="640" height="400" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window3.png" alt="">
9938
     * <dl>
9939
     *  <dt><b>Backpressure Support:</b></dt>
9940
     *  <dd>The operator honors backpressure on its outer subscriber, ignores backpressure in its inner Observables 
9941
     *  but each of them will emit at most {@code count} elements.</dd>
9942
     *  <dt><b>Scheduler:</b></dt>
9943
     *  <dd>This version of {@code window} does not operate by default on a particular {@link Scheduler}.</dd>
9944
     * </dl>
9945
     * 
9946
     * @param count
9947
     *            the maximum size of each window before it should be emitted
9948
     * @return an Observable that emits connected, non-overlapping windows, each containing at most
9949
     *         {@code count} items from the source Observable
9950
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
9951
     */
9952
    public final Observable<Observable<T>> window(int count) {
9953 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return window(count, count);
9954
    }
9955
9956
    /**
9957
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
9958
     * Observable emits windows every {@code skip} items, each containing no more than {@code count} items. When
9959
     * the source Observable completes or encounters an error, the resulting Observable emits the current window
9960
     * and propagates the notification from the source Observable.
9961
     * <p>
9962
     * <img width="640" height="365" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window4.png" alt="">
9963
     * <dl>
9964
     *  <dt><b>Backpressure Support:</b></dt>
9965
     *  <dd>The operator honors backpressure on its outer subscriber, ignores backpressure in its inner Observables 
9966
     *  but each of them will emit at most {@code count} elements.</dd>
9967
     *  <dt><b>Scheduler:</b></dt>
9968
     *  <dd>This version of {@code window} does not operate by default on a particular {@link Scheduler}.</dd>
9969
     * </dl>
9970
     * 
9971
     * @param count
9972
     *            the maximum size of each window before it should be emitted
9973
     * @param skip
9974
     *            how many items need to be skipped before starting a new window. Note that if {@code skip} and
9975
     *            {@code count} are equal this is the same operation as {@link #window(int)}.
9976
     * @return an Observable that emits windows every {@code skip} items containing at most {@code count} items
9977
     *         from the source Observable
9978
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
9979
     */
9980
    public final Observable<Observable<T>> window(int count, int skip) {
9981 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorWindowWithSize<T>(count, skip));
9982
    }
9983
9984
    /**
9985
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
9986
     * Observable starts a new window periodically, as determined by the {@code timeshift} argument. It emits
9987
     * each window after a fixed timespan, specified by the {@code timespan} argument. When the source
9988
     * Observable completes or Observable completes or encounters an error, the resulting Observable emits the
9989
     * current window and propagates the notification from the source Observable.
9990
     * <p>
9991
     * <img width="640" height="335" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window7.png" alt="">
9992
     * <dl>
9993
     *  <dt><b>Backpressure Support:</b></dt>
9994
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
9995
     *  <dt><b>Scheduler:</b></dt>
9996
     *  <dd>This version of {@code window} operates by default on the {@code computation} {@link Scheduler}.</dd>
9997
     * </dl>
9998
     * 
9999
     * @param timespan
10000
     *            the period of time each window collects items before it should be emitted
10001
     * @param timeshift
10002
     *            the period of time after which a new window will be created
10003
     * @param unit
10004
     *            the unit of time that applies to the {@code timespan} and {@code timeshift} arguments
10005
     * @return an Observable that emits new windows periodically as a fixed timespan elapses
10006
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10007
     */
10008
    public final Observable<Observable<T>> window(long timespan, long timeshift, TimeUnit unit) {
10009 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return window(timespan, timeshift, unit, Integer.MAX_VALUE, Schedulers.computation());
10010
    }
10011
10012
    /**
10013
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
10014
     * Observable starts a new window periodically, as determined by the {@code timeshift} argument. It emits
10015
     * each window after a fixed timespan, specified by the {@code timespan} argument. When the source
10016
     * Observable completes or Observable completes or encounters an error, the resulting Observable emits the
10017
     * current window and propagates the notification from the source Observable.
10018
     * <p>
10019
     * <img width="640" height="335" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window7.s.png" alt="">
10020
     * <dl>
10021
     *  <dt><b>Backpressure Support:</b></dt>
10022
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
10023
     *  <dt><b>Scheduler:</b></dt>
10024
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
10025
     * </dl>
10026
     * 
10027
     * @param timespan
10028
     *            the period of time each window collects items before it should be emitted
10029
     * @param timeshift
10030
     *            the period of time after which a new window will be created
10031
     * @param unit
10032
     *            the unit of time that applies to the {@code timespan} and {@code timeshift} arguments
10033
     * @param scheduler
10034
     *            the {@link Scheduler} to use when determining the end and start of a window
10035
     * @return an Observable that emits new windows periodically as a fixed timespan elapses
10036
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10037
     */
10038
    public final Observable<Observable<T>> window(long timespan, long timeshift, TimeUnit unit, Scheduler scheduler) {
10039 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return window(timespan, timeshift, unit, Integer.MAX_VALUE, scheduler);
10040
    }
10041
    
10042
    /**
10043
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
10044
     * Observable starts a new window periodically, as determined by the {@code timeshift} argument or a maximum
10045
     * size as specified by the {@code count} argument (whichever is reached first). It emits
10046
     * each window after a fixed timespan, specified by the {@code timespan} argument. When the source
10047
     * Observable completes or Observable completes or encounters an error, the resulting Observable emits the
10048
     * current window and propagates the notification from the source Observable.
10049
     * <p>
10050
     * <img width="640" height="335" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window7.s.png" alt="">
10051
     * <dl>
10052
     *  <dt><b>Backpressure Support:</b></dt>
10053
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
10054
     *  <dt><b>Scheduler:</b></dt>
10055
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
10056
     * </dl>
10057
     * 
10058
     * @param timespan
10059
     *            the period of time each window collects items before it should be emitted
10060
     * @param timeshift
10061
     *            the period of time after which a new window will be created
10062
     * @param unit
10063
     *            the unit of time that applies to the {@code timespan} and {@code timeshift} arguments
10064
     * @param count
10065
     *            the maximum size of each window before it should be emitted
10066
     * @param scheduler
10067
     *            the {@link Scheduler} to use when determining the end and start of a window
10068
     * @return an Observable that emits new windows periodically as a fixed timespan elapses
10069
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10070
     */
10071
    public final Observable<Observable<T>> window(long timespan, long timeshift, TimeUnit unit, int count, Scheduler scheduler) {
10072 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorWindowWithTime<T>(timespan, timeshift, unit, count, scheduler));
10073
    }
10074
10075
    /**
10076
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
10077
     * Observable emits connected, non-overlapping windows, each of a fixed duration specified by the
10078
     * {@code timespan} argument. When the source Observable completes or encounters an error, the resulting
10079
     * Observable emits the current window and propagates the notification from the source Observable.
10080
     * <p>
10081
     * <img width="640" height="375" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window5.png" alt="">
10082
     * <dl>
10083
     *  <dt><b>Backpressure Support:</b></dt>
10084
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
10085
     *  <dt><b>Scheduler:</b></dt>
10086
     *  <dd>This version of {@code window} operates by default on the {@code computation} {@link Scheduler}.</dd>
10087
     * </dl>
10088
     * 
10089
     * @param timespan
10090
     *            the period of time each window collects items before it should be emitted and replaced with a
10091
     *            new window
10092
     * @param unit
10093
     *            the unit of time that applies to the {@code timespan} argument
10094
     * @return an Observable that emits connected, non-overlapping windows represending items emitted by the
10095
     *         source Observable during fixed, consecutive durations
10096
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10097
     */
10098
    public final Observable<Observable<T>> window(long timespan, TimeUnit unit) {
10099 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return window(timespan, timespan, unit, Schedulers.computation());
10100
    }
10101
10102
    /**
10103
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
10104
     * Observable emits connected, non-overlapping windows, each of a fixed duration as specified by the
10105
     * {@code timespan} argument or a maximum size as specified by the {@code count} argument (whichever is
10106
     * reached first). When the source Observable completes or encounters an error, the resulting Observable
10107
     * emits the current window and propagates the notification from the source Observable.
10108
     * <p>
10109
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window6.png" alt="">
10110
     * <dl>
10111
     *  <dt><b>Backpressure Support:</b></dt>
10112
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
10113
     *  <dt><b>Scheduler:</b></dt>
10114
     *  <dd>This version of {@code window} operates by default on the {@code computation} {@link Scheduler}.</dd>
10115
     * </dl>
10116
     * 
10117
     * @param timespan
10118
     *            the period of time each window collects items before it should be emitted and replaced with a
10119
     *            new window
10120
     * @param unit
10121
     *            the unit of time that applies to the {@code timespan} argument
10122
     * @param count
10123
     *            the maximum size of each window before it should be emitted
10124
     * @return an Observable that emits connected, non-overlapping windows of items from the source Observable
10125
     *         that were emitted during a fixed duration of time or when the window has reached maximum capacity
10126
     *         (whichever occurs first)
10127
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10128
     */
10129
    public final Observable<Observable<T>> window(long timespan, TimeUnit unit, int count) {
10130 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE
        return window(timespan, unit, count, Schedulers.computation());
10131
    }
10132
10133
    /**
10134
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
10135
     * Observable emits connected, non-overlapping windows, each of a fixed duration specified by the
10136
     * {@code timespan} argument or a maximum size specified by the {@code count} argument (whichever is reached
10137
     * first). When the source Observable completes or encounters an error, the resulting Observable emits the
10138
     * current window and propagates the notification from the source Observable.
10139
     * <p>
10140
     * <img width="640" height="370" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window6.s.png" alt="">
10141
     * <dl>
10142
     *  <dt><b>Backpressure Support:</b></dt>
10143
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
10144
     *  <dt><b>Scheduler:</b></dt>
10145
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
10146
     * </dl>
10147
     * 
10148
     * @param timespan
10149
     *            the period of time each window collects items before it should be emitted and replaced with a
10150
     *            new window
10151
     * @param unit
10152
     *            the unit of time which applies to the {@code timespan} argument
10153
     * @param count
10154
     *            the maximum size of each window before it should be emitted
10155
     * @param scheduler
10156
     *            the {@link Scheduler} to use when determining the end and start of a window
10157
     * @return an Observable that emits connected, non-overlapping windows of items from the source Observable
10158
     *         that were emitted during a fixed duration of time or when the window has reached maximum capacity
10159
     *         (whichever occurs first)
10160
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10161
     */
10162
    public final Observable<Observable<T>> window(long timespan, TimeUnit unit, int count, Scheduler scheduler) {
10163 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return window(timespan, timespan, unit, count, scheduler);
10164
    }
10165
10166
    /**
10167
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
10168
     * Observable emits connected, non-overlapping windows, each of a fixed duration as specified by the
10169
     * {@code timespan} argument. When the source Observable completes or encounters an error, the resulting
10170
     * Observable emits the current window and propagates the notification from the source Observable.
10171
     * <p>
10172
     * <img width="640" height="375" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window5.s.png" alt="">
10173
     * <dl>
10174
     *  <dt><b>Backpressure Support:</b></dt>
10175
     *  <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
10176
     *  <dt><b>Scheduler:</b></dt>
10177
     *  <dd>you specify which {@link Scheduler} this operator will use</dd>
10178
     * </dl>
10179
     * 
10180
     * @param timespan
10181
     *            the period of time each window collects items before it should be emitted and replaced with a
10182
     *            new window
10183
     * @param unit
10184
     *            the unit of time which applies to the {@code timespan} argument
10185
     * @param scheduler
10186
     *            the {@link Scheduler} to use when determining the end and start of a window
10187
     * @return an Observable that emits connected, non-overlapping windows containing items emitted by the
10188
     *         source Observable within a fixed duration
10189
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10190
     */
10191
    public final Observable<Observable<T>> window(long timespan, TimeUnit unit, Scheduler scheduler) {
10192 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return window(timespan, unit, Integer.MAX_VALUE, scheduler);
10193
    }
10194
10195
    /**
10196
     * Returns an Observable that emits windows of items it collects from the source Observable. The resulting
10197
     * Observable emits windows that contain those items emitted by the source Observable between the time when
10198
     * the {@code windowOpenings} Observable emits an item and when the Observable returned by
10199
     * {@code closingSelector} emits an item.
10200
     * <p>
10201
     * <img width="640" height="550" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window2.png" alt="">
10202
     * <dl>
10203
     *  <dt><b>Backpressure Support:</b></dt>
10204
     *  <dd>This operator does not support backpressure as it uses Observables to control data flow.</dd>
10205
     *  <dt><b>Scheduler:</b></dt>
10206
     *  <dd>This version of {@code window} does not operate by default on a particular {@link Scheduler}.</dd>
10207
     * </dl>
10208
     * 
10209
     * @param windowOpenings
10210
     *            an Observable that, when it emits an item, causes another window to be created
10211
     * @param closingSelector
10212
     *            a {@link Func1} that produces an Observable for every window created. When this Observable
10213
     *            emits an item, the associated window is closed and emitted
10214
     * @return an Observable that emits windows of items emitted by the source Observable that are governed by
10215
     *         the specified window-governing Observables
10216
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10217
     */
10218
    public final <TOpening, TClosing> Observable<Observable<T>> window(Observable<? extends TOpening> windowOpenings, Func1<? super TOpening, ? extends Observable<? extends TClosing>> closingSelector) {
10219 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorWindowWithStartEndObservable<T, TOpening, TClosing>(windowOpenings, closingSelector));
10220
    }
10221
10222
    /**
10223
     * Returns an Observable that emits non-overlapping windows of items it collects from the source Observable
10224
     * where the boundary of each window is determined by the items emitted from a specified boundary-governing
10225
     * Observable.
10226
     * <p>
10227
     * <img width="640" height="475" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/window8.png" alt="">
10228
     * <dl>
10229
     *  <dt><b>Backpressure Support:</b></dt>
10230
     *  <dd>This operator does not support backpressure as it uses a {@code boundary} Observable to control data
10231
     *      flow.</dd>
10232
     *  <dt><b>Scheduler:</b></dt>
10233
     *  <dd>This version of {@code window} does not operate by default on a particular {@link Scheduler}.</dd>
10234
     * </dl>
10235
     * 
10236
     * @param <U>
10237
     *            the window element type (ignored)
10238
     * @param boundary
10239
     *            an Observable whose emitted items close and open windows
10240
     * @return an Observable that emits non-overlapping windows of items it collects from the source Observable
10241
     *         where the boundary of each window is determined by the items emitted from the {@code boundary}
10242
     *         Observable
10243
     * @see <a href="http://reactivex.io/documentation/operators/window.html">ReactiveX operators documentation: Window</a>
10244
     */
10245
    public final <U> Observable<Observable<T>> window(Observable<U> boundary) {
10246 1 1. window : mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorWindowWithObservable<T, U>(boundary));
10247
    }
10248
10249
    /**
10250
     * Returns an Observable that emits items that are the result of applying a specified function to pairs of
10251
     * values, one each from the source Observable and a specified Iterable sequence.
10252
     * <p>
10253
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.i.png" alt="">
10254
     * <p>
10255
     * Note that the {@code other} Iterable is evaluated as items are observed from the source Observable; it is
10256
     * not pre-consumed. This allows you to zip infinite streams on either side.
10257
     * <dl>
10258
     *  <dt><b>Scheduler:</b></dt>
10259
     *  <dd>{@code zipWith} does not operate by default on a particular {@link Scheduler}.</dd>
10260
     * </dl>
10261
     * 
10262
     * @param <T2>
10263
     *            the type of items in the {@code other} Iterable
10264
     * @param <R>
10265
     *            the type of items emitted by the resulting Observable
10266
     * @param other
10267
     *            the Iterable sequence
10268
     * @param zipFunction
10269
     *            a function that combines the pairs of items from the Observable and the Iterable to generate
10270
     *            the items to be emitted by the resulting Observable
10271
     * @return an Observable that pairs up values from the source Observable and the {@code other} Iterable
10272
     *         sequence and emits the results of {@code zipFunction} applied to these pairs
10273
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
10274
     */
10275
    public final <T2, R> Observable<R> zipWith(Iterable<? extends T2> other, Func2<? super T, ? super T2, ? extends R> zipFunction) {
10276 1 1. zipWith : mutated return of Object value for rx/Observable::zipWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return lift(new OperatorZipIterable<T, T2, R>(other, zipFunction));
10277
    }
10278
10279
    /**
10280
     * Returns an Observable that emits items that are the result of applying a specified function to pairs of
10281
     * values, one each from the source Observable and another specified Observable.
10282
     * <p>
10283
     * <img width="640" height="380" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/zip.png" alt="">
10284
     * <dl>
10285
     *  <dt><b>Scheduler:</b></dt>
10286
     *  <dd>{@code zipWith} does not operate by default on a particular {@link Scheduler}.</dd>
10287
     * </dl>
10288
     * 
10289
     * @param <T2>
10290
     *            the type of items emitted by the {@code other} Observable
10291
     * @param <R>
10292
     *            the type of items emitted by the resulting Observable
10293
     * @param other
10294
     *            the other Observable
10295
     * @param zipFunction
10296
     *            a function that combines the pairs of items from the two Observables to generate the items to
10297
     *            be emitted by the resulting Observable
10298
     * @return an Observable that pairs up values from the source Observable and the {@code other} Observable
10299
     *         and emits the results of {@code zipFunction} applied to these pairs
10300
     * @see <a href="http://reactivex.io/documentation/operators/zip.html">ReactiveX operators documentation: Zip</a>
10301
     */
10302
    public final <T2, R> Observable<R> zipWith(Observable<? extends T2> other, Func2<? super T, ? super T2, ? extends R> zipFunction) {
10303 1 1. zipWith : mutated return of Object value for rx/Observable::zipWith to ( if (x != null) null else throw new RuntimeException ) → KILLED
        return zip(this, other, zipFunction);
10304
    }
10305
10306
    /**
10307
     * An Observable that never sends any information to an {@link Observer}.
10308
     * This Observable is useful primarily for testing purposes.
10309
     * 
10310
     * @param <T>
10311
     *            the type of item (not) emitted by the Observable
10312
     */
10313
    private static class NeverObservable<T> extends Observable<T> {
10314
        
10315
        private static class Holder {
10316
            static final NeverObservable<?> INSTANCE = new NeverObservable<Object>();
10317
        }
10318
        
10319
        /**
10320
         * Returns a singleton instance of NeverObservble (cast to the generic type).
10321
         * 
10322
         * @return
10323
         */
10324
        @SuppressWarnings("unchecked")
10325
        static <T> NeverObservable<T> instance() {
10326 1 1. instance : mutated return of Object value for rx/Observable$NeverObservable::instance to ( if (x != null) null else throw new RuntimeException ) → KILLED
            return (NeverObservable<T>) Holder.INSTANCE;
10327
        }
10328
        
10329
        NeverObservable() {
10330
            super(new OnSubscribe<T>() {
10331
10332
                @Override
10333
                public void call(Subscriber<? super T> observer) {
10334
                    // do nothing
10335
                }
10336
10337
            });
10338
        }
10339
    }
10340
10341
    /**
10342
     * An Observable that invokes {@link Observer#onError onError} when the {@link Observer} subscribes to it.
10343
     * 
10344
     * @param <T>
10345
     *            the type of item (ostensibly) emitted by the Observable
10346
     */
10347
    private static class ThrowObservable<T> extends Observable<T> {
10348
10349
        public ThrowObservable(final Throwable exception) {
10350
            super(new OnSubscribe<T>() {
10351
10352
                /**
10353
                 * Accepts an {@link Observer} and calls its {@link Observer#onError onError} method.
10354
                 * 
10355
                 * @param observer
10356
                 *            an {@link Observer} of this Observable
10357
                 */
10358
                @Override
10359
                public void call(Subscriber<? super T> observer) {
10360 1 1. call : removed call to rx/Subscriber::onError → KILLED
                    observer.onError(exception);
10361
                }
10362
10363
            });
10364
        }
10365
    }
10366
10367
}

Mutations

95

1.1
Location : create
Killed by : rx.internal.operators.OperatorElementAtTest.testElementAtWithMinusIndex(rx.internal.operators.OperatorElementAtTest)
mutated return of Object value for rx/Observable::create to ( if (x != null) null else throw new RuntimeException ) → KILLED

131

1.1
Location : create
Killed by : rx.observables.SyncOnSubscribeTest.testExtendingBase(rx.observables.SyncOnSubscribeTest)
mutated return of Object value for rx/Observable::create to ( if (x != null) null else throw new RuntimeException ) → KILLED

166

1.1
Location : create
Killed by : none
mutated return of Object value for rx/Observable::create to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

194

1.1
Location : extend
Killed by : rx.ObservableConversionTest.testConversionBetweenObservableClasses(rx.ObservableConversionTest)
mutated return of Object value for rx/Observable::extend to ( if (x != null) null else throw new RuntimeException ) → KILLED

197

1.1
Location : call
Killed by : none
removed call to rx/Subscriber::add → SURVIVED

225

1.1
Location : lift
Killed by : rx.internal.operators.OperatorLastTest.testLastViaObservable(rx.internal.operators.OperatorLastTest)
mutated return of Object value for rx/Observable::lift to ( if (x != null) null else throw new RuntimeException ) → KILLED

232

1.1
Location : call
Killed by : rx.SubscriberTest.testOnStartCalledOnceViaLift(rx.SubscriberTest)
removed call to rx/Subscriber::onStart → KILLED

233

1.1
Location : call
Killed by : rx.SubscriberTest.testRequestThroughMap(rx.SubscriberTest)
removed call to rx/Observable$OnSubscribe::call → KILLED

238

1.1
Location : call
Killed by : rx.internal.operators.OperatorSkipWhileTest.testPredicateFatalError(rx.internal.operators.OperatorSkipWhileTest)
removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED

239

1.1
Location : call
Killed by : none
removed call to rx/Subscriber::onError → TIMED_OUT

242

1.1
Location : call
Killed by : rx.internal.operators.OperatorSkipWhileTest.testPredicateFatalError(rx.internal.operators.OperatorSkipWhileTest)
removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED

245

1.1
Location : call
Killed by : rx.internal.operators.OperatorOnErrorResumeNextViaFunctionTest.testOnErrorResumeReceivesErrorFromPreviousNonProtectedOperator(rx.internal.operators.OperatorOnErrorResumeNextViaFunctionTest)
removed call to rx/Subscriber::onError → KILLED

271

1.1
Location : compose
Killed by : rx.ObservableTests.testCompose(rx.ObservableTests)
mutated return of Object value for rx/Observable::compose to ( if (x != null) null else throw new RuntimeException ) → KILLED

303

1.1
Location : toSingle
Killed by : rx.internal.operators.OnSubscribeSingleTest.testErrorObservable(rx.internal.operators.OnSubscribeSingleTest)
mutated return of Object value for rx/Observable::toSingle to ( if (x != null) null else throw new RuntimeException ) → KILLED

328

1.1
Location : toCompletable
Killed by : rx.internal.operators.OnSubscribeCompletableTest.testNeverObservable(rx.internal.operators.OnSubscribeCompletableTest)
mutated return of Object value for rx/Observable::toCompletable to ( if (x != null) null else throw new RuntimeException ) → KILLED

354

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

376

1.1
Location : amb
Killed by : rx.internal.operators.OnSubscribeAmbTest.testProducerRequestThroughAmb(rx.internal.operators.OnSubscribeAmbTest)
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → KILLED

400

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

426

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

454

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

484

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

516

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

550

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

586

1.1
Location : amb
Killed by : none
mutated return of Object value for rx/Observable::amb to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

612

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test2SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

640

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test3SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

671

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test4SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

704

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test5SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

739

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test6SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

776

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test7SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

815

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test8SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

857

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.test9SourcesOverload(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

881

1.1
Location : combineLatest
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.testZeroSources(rx.internal.operators.OnSubscribeCombineLatestTest)
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

906

1.1
Location : combineLatest
Killed by : none
mutated return of Object value for rx/Observable::combineLatest to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

926

1.1
Location : concat
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → KILLED

948

1.1
Location : concat
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → KILLED

972

1.1
Location : concat
Killed by : none
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

998

1.1
Location : concat
Killed by : none
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1026

1.1
Location : concat
Killed by : none
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1056

1.1
Location : concat
Killed by : none
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1088

1.1
Location : concat
Killed by : none
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1122

1.1
Location : concat
Killed by : none
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1158

1.1
Location : concat
Killed by : none
mutated return of Object value for rx/Observable::concat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1186

1.1
Location : defer
Killed by : rx.internal.operators.OnSubscribeDeferTest.testDeferFunctionThrows(rx.internal.operators.OnSubscribeDeferTest)
mutated return of Object value for rx/Observable::defer to ( if (x != null) null else throw new RuntimeException ) → KILLED

1194

1.1
Location : call
Killed by : rx.internal.operators.OnSubscribeRangeTest.testEmptyRangeSendsOnCompleteEagerlyWithRequestZero(rx.internal.operators.OnSubscribeRangeTest)
removed call to rx/Subscriber::onCompleted → KILLED

1217

1.1
Location : empty
Killed by : rx.internal.operators.OperatorOnBackpressureBufferTest.testFixBackpressureBufferNegativeCapacity(rx.internal.operators.OperatorOnBackpressureBufferTest)
mutated return of Object value for rx/Observable::empty to ( if (x != null) null else throw new RuntimeException ) → KILLED

1239

1.1
Location : error
Killed by : rx.ObservableTests.testForEachWithNull(rx.ObservableTests)
mutated return of Object value for rx/Observable::error to ( if (x != null) null else throw new RuntimeException ) → KILLED

1266

1.1
Location : from
Killed by : rx.CompletableTest.fromFutureThrows(rx.CompletableTest)
mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → KILLED

1297

1.1
Location : from
Killed by : none
mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1326

1.1
Location : from
Killed by : none
mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1347

1.1
Location : from
Killed by : rx.internal.operators.OperatorElementAtTest.testElementAtWithMinusIndex(rx.internal.operators.OperatorElementAtTest)
mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → KILLED

1368

1.1
Location : from
Killed by : rx.SubscriberTest.testOnStartRequestsAreAdditive(rx.SubscriberTest)
negated conditional → KILLED

1369

1.1
Location : from
Killed by : none
mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1371

1.1
Location : from
Killed by : rx.SubscriberTest.testOnStartRequestsAreAdditive(rx.SubscriberTest)
negated conditional → KILLED

1372

1.1
Location : from
Killed by : none
mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1374

1.1
Location : from
Killed by : rx.internal.operators.OperatorLastTest.testLastViaObservable(rx.internal.operators.OperatorLastTest)
mutated return of Object value for rx/Observable::from to ( if (x != null) null else throw new RuntimeException ) → KILLED

1401

1.1
Location : fromCallable
Killed by : rx.internal.operators.OnSubscribeFromCallableTest.shouldNotInvokeFuncUntilSubscription(rx.internal.operators.OnSubscribeFromCallableTest)
mutated return of Object value for rx/Observable::fromCallable to ( if (x != null) null else throw new RuntimeException ) → KILLED

1421

1.1
Location : interval
Killed by : rx.internal.operators.OperatorGroupByTest.testGroupByOnAsynchronousSourceAcceptsMultipleSubscriptions(rx.internal.operators.OperatorGroupByTest)
mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED

1444

1.1
Location : interval
Killed by : rx.internal.operators.OnSubscribeTimerTest.testInterval(rx.internal.operators.OnSubscribeTimerTest)
mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED

1472

1.1
Location : interval
Killed by : rx.internal.operators.OnSubscribeRefCountTest.testRefCountAsync(rx.internal.operators.OnSubscribeRefCountTest)
mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED

1502

1.1
Location : interval
Killed by : rx.internal.operators.OnSubscribeTimerTest.testTimerPeriodically(rx.internal.operators.OnSubscribeTimerTest)
mutated return of Object value for rx/Observable::interval to ( if (x != null) null else throw new RuntimeException ) → KILLED

1530

1.1
Location : just
Killed by : rx.CovarianceTest.testCovarianceOfCompose(rx.CovarianceTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1554

1.1
Location : just
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1580

1.1
Location : just
Killed by : rx.internal.operators.OperatorLastTest.testLastViaObservable(rx.internal.operators.OperatorLastTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1608

1.1
Location : just
Killed by : rx.SubscriberTest.testNegativeRequestThrowsIllegalArgumentException(rx.SubscriberTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1638

1.1
Location : just
Killed by : rx.SubscriberTest.testOnStartRequestsAreAdditive(rx.SubscriberTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1670

1.1
Location : just
Killed by : rx.internal.operators.OperatorToMultimapTest.testToMultimapWithMapThrowingFactory(rx.internal.operators.OperatorToMultimapTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1704

1.1
Location : just
Killed by : rx.internal.operators.OperatorSkipWhileTest.testSkipEverything(rx.internal.operators.OperatorSkipWhileTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1740

1.1
Location : just
Killed by : rx.internal.operators.OperatorDistinctUntilChangedTest.testDistinctUntilChangedOfSourceWithNulls(rx.internal.operators.OperatorDistinctUntilChangedTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1778

1.1
Location : just
Killed by : rx.internal.operators.OperatorDistinctTest.testDistinctOfNormalSource(rx.internal.operators.OperatorDistinctTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1818

1.1
Location : just
Killed by : rx.schedulers.ImmediateSchedulerTest.testObserveOn(rx.schedulers.ImmediateSchedulerTest)
mutated return of Object value for rx/Observable::just to ( if (x != null) null else throw new RuntimeException ) → KILLED

1840

1.1
Location : merge
Killed by : rx.internal.operators.OperatorMergeTest.testMergeList(rx.internal.operators.OperatorMergeTest)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

1867

1.1
Location : merge
Killed by : rx.internal.operators.OperatorMergeMaxConcurrentTest.testSimpleOneLess(rx.internal.operators.OperatorMergeMaxConcurrentTest)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

1891

1.1
Location : merge
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
negated conditional → KILLED

1892

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

1894

1.1
Location : merge
Killed by : rx.ObservableTests.testMergeWith(rx.ObservableTests)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

1924

1.1
Location : merge
Killed by : rx.internal.operators.OperatorMergeTest.zeroMaxConcurrent(rx.internal.operators.OperatorMergeTest)
negated conditional → KILLED

1925

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

1927

1.1
Location : merge
Killed by : rx.internal.operators.OperatorMergeMaxConcurrentTest.testSimpleOneLess(rx.internal.operators.OperatorMergeMaxConcurrentTest)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

1951

1.1
Location : merge
Killed by : rx.ObservableTests.testMergeWith(rx.ObservableTests)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

1977

1.1
Location : merge
Killed by : rx.internal.operators.OperatorMergeTest.testConcurrencyWithBrokenOnCompleteContract(rx.internal.operators.OperatorMergeTest)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

2005

1.1
Location : merge
Killed by : rx.internal.operators.OperatorMergeTest.testError2(rx.internal.operators.OperatorMergeTest)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

2035

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2067

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2101

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2137

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2175

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2196

1.1
Location : merge
Killed by : rx.ObservableTests.testMergeWith(rx.ObservableTests)
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → KILLED

2221

1.1
Location : merge
Killed by : none
mutated return of Object value for rx/Observable::merge to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2249

1.1
Location : mergeDelayError
Killed by : rx.internal.operators.OperatorMergeDelayErrorTest.testSynchronousError(rx.internal.operators.OperatorMergeDelayErrorTest)
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED

2282

1.1
Location : mergeDelayError
Killed by : rx.internal.operators.OperatorMergeDelayErrorTest.testDelayErrorMaxConcurrent(rx.internal.operators.OperatorMergeDelayErrorTest)
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED

2310

1.1
Location : mergeDelayError
Killed by : rx.internal.operators.OperatorMergeDelayErrorTest.mergeIterable(rx.internal.operators.OperatorMergeDelayErrorTest)
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED

2340

1.1
Location : mergeDelayError
Killed by : none
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2370

1.1
Location : mergeDelayError
Killed by : rx.internal.operators.OperatorMergeDelayErrorTest.testMergeArray(rx.internal.operators.OperatorMergeDelayErrorTest)
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED

2402

1.1
Location : mergeDelayError
Killed by : rx.internal.operators.OperatorMergeTest.shouldNotReceivedDelayedErrorWhileThereAreStillScalarSynchronousEmissionsInTheQueue(rx.internal.operators.OperatorMergeTest)
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED

2436

1.1
Location : mergeDelayError
Killed by : rx.internal.operators.OperatorMergeDelayErrorTest.testErrorDelayed4(rx.internal.operators.OperatorMergeDelayErrorTest)
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → KILLED

2472

1.1
Location : mergeDelayError
Killed by : none
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2510

1.1
Location : mergeDelayError
Killed by : none
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2551

1.1
Location : mergeDelayError
Killed by : none
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2594

1.1
Location : mergeDelayError
Killed by : none
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2638

1.1
Location : mergeDelayError
Killed by : none
mutated return of Object value for rx/Observable::mergeDelayError to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2655

1.1
Location : nest
Killed by : rx.internal.operators.OperatorRetryWithPredicateTest.testUnsubscribeFromRetry(rx.internal.operators.OperatorRetryWithPredicateTest)
mutated return of Object value for rx/Observable::nest to ( if (x != null) null else throw new RuntimeException ) → KILLED

2675

1.1
Location : never
Killed by : rx.internal.operators.OnSubscribeCompletableTest.testNeverObservable(rx.internal.operators.OnSubscribeCompletableTest)
mutated return of Object value for rx/Observable::never to ( if (x != null) null else throw new RuntimeException ) → KILLED

2698

1.1
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testRangeWithOverflow2(rx.internal.operators.OnSubscribeRangeTest)
changed conditional boundary → KILLED

2.2
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testRangeWithOverflow2(rx.internal.operators.OnSubscribeRangeTest)
negated conditional → KILLED

2701

1.1
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testRangeWithOverflow2(rx.internal.operators.OnSubscribeRangeTest)
negated conditional → KILLED

2702

1.1
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testEmptyRangeSendsOnCompleteEagerlyWithRequestZero(rx.internal.operators.OnSubscribeRangeTest)
mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED

2704

1.1
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testRangeWithOverflow3(rx.internal.operators.OnSubscribeRangeTest)
changed conditional boundary → KILLED

2.2
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testRangeWithOverflow3(rx.internal.operators.OnSubscribeRangeTest)
Replaced integer subtraction with addition → KILLED

3.3
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testRangeWithOverflow3(rx.internal.operators.OnSubscribeRangeTest)
Replaced integer addition with subtraction → KILLED

4.4
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testRangeWithOverflow4(rx.internal.operators.OnSubscribeRangeTest)
negated conditional → KILLED

2707

1.1
Location : range
Killed by : rx.internal.operators.OperatorScanTest.testBackpressureWithoutInitialValue(rx.internal.operators.OperatorScanTest)
negated conditional → KILLED

2708

1.1
Location : range
Killed by : rx.CompletableTest.fromObservableSome(rx.CompletableTest)
mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED

2710

1.1
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testNearMaxValueWithoutBackpressure(rx.internal.operators.OnSubscribeRangeTest)
Replaced integer subtraction with addition → KILLED

2.2
Location : range
Killed by : rx.internal.operators.OnSubscribeRangeTest.testNearMaxValueWithoutBackpressure(rx.internal.operators.OnSubscribeRangeTest)
Replaced integer addition with subtraction → KILLED

3.3
Location : range
Killed by : rx.internal.operators.OperatorTakeTest.takeNegative(rx.internal.operators.OperatorTakeTest)
mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED

2733

1.1
Location : range
Killed by : rx.ObservableTests.testRangeWithScheduler(rx.ObservableTests)
mutated return of Object value for rx/Observable::range to ( if (x != null) null else throw new RuntimeException ) → KILLED

2756

1.1
Location : sequenceEqual
Killed by : rx.internal.operators.OperatorSequenceEqualTest.testWithError1(rx.internal.operators.OperatorSequenceEqualTest)
mutated return of Object value for rx/Observable::sequenceEqual to ( if (x != null) null else throw new RuntimeException ) → KILLED

2759

1.1
Location : call
Killed by : rx.internal.operators.OperatorSequenceEqualTest.testWithNull1(rx.internal.operators.OperatorSequenceEqualTest)
negated conditional → KILLED

2760

1.1
Location : call
Killed by : rx.internal.operators.OperatorSequenceEqualTest.testWithNull1(rx.internal.operators.OperatorSequenceEqualTest)
negated conditional → KILLED

2.2
Location : call
Killed by : rx.internal.operators.OperatorSequenceEqualTest.testWithNull1(rx.internal.operators.OperatorSequenceEqualTest)
mutated return of Object value for rx/Observable$3::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

2762

1.1
Location : call
Killed by : rx.internal.operators.OperatorSequenceEqualTest.test3(rx.internal.operators.OperatorSequenceEqualTest)
mutated return of Object value for rx/Observable$3::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

2791

1.1
Location : sequenceEqual
Killed by : rx.internal.operators.OperatorSequenceEqualTest.testWithError1(rx.internal.operators.OperatorSequenceEqualTest)
mutated return of Object value for rx/Observable::sequenceEqual to ( if (x != null) null else throw new RuntimeException ) → KILLED

2817

1.1
Location : switchOnNext
Killed by : rx.internal.operators.OperatorSwitchTest.testUnsubscribe(rx.internal.operators.OperatorSwitchTest)
mutated return of Object value for rx/Observable::switchOnNext to ( if (x != null) null else throw new RuntimeException ) → KILLED

2846

1.1
Location : timer
Killed by : none
mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2877

1.1
Location : timer
Killed by : none
mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

2900

1.1
Location : timer
Killed by : none
mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → TIMED_OUT

2927

1.1
Location : timer
Killed by : rx.internal.operators.OnSubscribeTimerTest.testTimerOnce(rx.internal.operators.OnSubscribeTimerTest)
mutated return of Object value for rx/Observable::timer to ( if (x != null) null else throw new RuntimeException ) → KILLED

2952

1.1
Location : using
Killed by : rx.internal.operators.OnSubscribeUsingTest.testUsingWithResourceFactoryError(rx.internal.operators.OnSubscribeUsingTest)
mutated return of Object value for rx/Observable::using to ( if (x != null) null else throw new RuntimeException ) → KILLED

2988

1.1
Location : using
Killed by : rx.internal.operators.OnSubscribeUsingTest.testUsingWithResourceFactoryError(rx.internal.operators.OnSubscribeUsingTest)
mutated return of Object value for rx/Observable::using to ( if (x != null) null else throw new RuntimeException ) → KILLED

3019

1.1
Location : zip
Killed by : rx.internal.operators.OperatorZipTest.testStartEmptyList(rx.internal.operators.OperatorZipTest)
negated conditional → KILLED

3022

1.1
Location : zip
Killed by : rx.ZipTests.nonBlockingObservable(rx.ZipTests)
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → KILLED

3052

1.1
Location : zip
Killed by : rx.internal.operators.OperatorZipTest.testZipObservableObservableBackpressure(rx.internal.operators.OperatorZipTest)
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → KILLED

3056

1.1
Location : call
Killed by : rx.internal.operators.OperatorZipTest.testZipObservableObservableBackpressure(rx.internal.operators.OperatorZipTest)
mutated return of Object value for rx/Observable$4::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

3092

1.1
Location : zip
Killed by : rx.internal.operators.OperatorZipIterableTest.testZipIterableEmptyFirstSize(rx.internal.operators.OperatorZipIterableTest)
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → KILLED

3128

1.1
Location : zip
Killed by : none
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → TIMED_OUT

3166

1.1
Location : zip
Killed by : none
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3206

1.1
Location : zip
Killed by : none
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3248

1.1
Location : zip
Killed by : none
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3292

1.1
Location : zip
Killed by : none
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3338

1.1
Location : zip
Killed by : none
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3386

1.1
Location : zip
Killed by : none
mutated return of Object value for rx/Observable::zip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3406

1.1
Location : all
Killed by : rx.internal.operators.OperatorAllTest.testBackpressureIfNoneRequestedNoneShouldBeDelivered(rx.internal.operators.OperatorAllTest)
mutated return of Object value for rx/Observable::all to ( if (x != null) null else throw new RuntimeException ) → KILLED

3426

1.1
Location : ambWith
Killed by : rx.ObservableTests.testAmbWith(rx.ObservableTests)
mutated return of Object value for rx/Observable::ambWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

3441

1.1
Location : asObservable
Killed by : rx.internal.operators.OperatorAsObservableTest.testHiding(rx.internal.operators.OperatorAsObservableTest)
mutated return of Object value for rx/Observable::asObservable to ( if (x != null) null else throw new RuntimeException ) → KILLED

3467

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.testObservableBasedCloser(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3489

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.bufferWithSizeThrows(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3515

1.1
Location : buffer
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3545

1.1
Location : buffer
Killed by : none
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3577

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.testBufferStopsWhenUnsubscribed1(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3605

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.testBufferWithTimeDoesntUnsubscribeDownstream(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3637

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.testLongTimeAction(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3672

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.testTimedAndCount(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3703

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.bufferWithTimeTake1(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3730

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.bufferWithStartEndEndFunctionThrows(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3760

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.bufferWithBOEmptyLastViaBoundary(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3792

1.1
Location : buffer
Killed by : rx.internal.operators.OperatorBufferTest.bufferWithBOEmptyLastViaBoundary(rx.internal.operators.OperatorBufferTest)
mutated return of Object value for rx/Observable::buffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

3826

1.1
Location : cache
Killed by : rx.internal.operators.OperatorReplayTest.testUnsubscribeSource(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::cache to ( if (x != null) null else throw new RuntimeException ) → KILLED

3835

1.1
Location : cache
Killed by : none
mutated return of Object value for rx/Observable::cache to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

3873

1.1
Location : cacheWithInitialCapacity
Killed by : rx.ObservableTests.testCacheWithCapacity(rx.ObservableTests)
mutated return of Object value for rx/Observable::cacheWithInitialCapacity to ( if (x != null) null else throw new RuntimeException ) → KILLED

3894

1.1
Location : cast
Killed by : rx.internal.operators.OperatorCastTest.testCastWithWrongType(rx.internal.operators.OperatorCastTest)
mutated return of Object value for rx/Observable::cast to ( if (x != null) null else throw new RuntimeException ) → KILLED

3926

1.1
Location : call
Killed by : rx.ObservableTests.testCollectToString(rx.ObservableTests)
removed call to rx/functions/Action2::call → KILLED

3927

1.1
Location : call
Killed by : rx.ObservableTests.testCollectToString(rx.ObservableTests)
mutated return of Object value for rx/Observable$5::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

3938

1.1
Location : collect
Killed by : rx.ObservableTests.testCollectToString(rx.ObservableTests)
mutated return of Object value for rx/Observable::collect to ( if (x != null) null else throw new RuntimeException ) → KILLED

3960

1.1
Location : concatMap
Killed by : rx.observables.AsyncOnSubscribeTest.testOnCompleteOuter(rx.observables.AsyncOnSubscribeTest)
mutated return of Object value for rx/Observable::concatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

3983

1.1
Location : concatMapIterable
Killed by : rx.internal.operators.OperatorConcatTest.testConcatMapIterable(rx.internal.operators.OperatorConcatTest)
mutated return of Object value for rx/Observable::concatMapIterable to ( if (x != null) null else throw new RuntimeException ) → KILLED

4003

1.1
Location : concatWith
Killed by : rx.internal.operators.OperatorConcatTest.testRequestOverflowDoesNotStallStream(rx.internal.operators.OperatorConcatTest)
mutated return of Object value for rx/Observable::concatWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

4023

1.1
Location : contains
Killed by : rx.ObservableTests.testContainsWithEmptyObservable(rx.ObservableTests)
mutated return of Object value for rx/Observable::contains to ( if (x != null) null else throw new RuntimeException ) → KILLED

4026

1.1
Location : call
Killed by : rx.ObservableTests.testContainsWithInexistence(rx.ObservableTests)
negated conditional → KILLED

2.2
Location : call
Killed by : none
negated conditional → SURVIVED

3.3
Location : call
Killed by : rx.ObservableTests.testContainsWithInexistence(rx.ObservableTests)
mutated return of Object value for rx/Observable$6::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

4048

1.1
Location : count
Killed by : rx.ObservableTests.testCountError(rx.ObservableTests)
mutated return of Object value for rx/Observable::count to ( if (x != null) null else throw new RuntimeException ) → KILLED

4055

1.1
Location : call
Killed by : rx.ObservableTests.fromArityArgs3(rx.ObservableTests)
Replaced integer addition with subtraction → KILLED

2.2
Location : call
Killed by : rx.internal.operators.OperatorScanTest.scanShouldPassUpstreamARequestForMaxValue(rx.internal.operators.OperatorScanTest)
mutated return of Object value for rx/Observable$CountHolder$1::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

4079

1.1
Location : countLong
Killed by : none
mutated return of Object value for rx/Observable::countLong to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

4086

1.1
Location : call
Killed by : none
Replaced long addition with subtraction → NO_COVERAGE

2.2
Location : call
Killed by : none
mutated return of Object value for rx/Observable$CountLongHolder$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

4114

1.1
Location : debounce
Killed by : rx.internal.operators.OperatorDebounceTest.debounceSelectorObservableThrows(rx.internal.operators.OperatorDebounceTest)
mutated return of Object value for rx/Observable::debounce to ( if (x != null) null else throw new RuntimeException ) → KILLED

4153

1.1
Location : debounce
Killed by : none
mutated return of Object value for rx/Observable::debounce to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

4195

1.1
Location : debounce
Killed by : rx.internal.operators.OperatorDebounceTest.testDebounceNeverEmits(rx.internal.operators.OperatorDebounceTest)
mutated return of Object value for rx/Observable::debounce to ( if (x != null) null else throw new RuntimeException ) → KILLED

4216

1.1
Location : defaultIfEmpty
Killed by : rx.internal.operators.OperatorDefaultIfEmptyTest.testDefaultIfEmptyWithEmpty(rx.internal.operators.OperatorDefaultIfEmptyTest)
mutated return of Object value for rx/Observable::defaultIfEmpty to ( if (x != null) null else throw new RuntimeException ) → KILLED

4220

1.1
Location : call
Killed by : rx.internal.operators.OperatorDefaultIfEmptyTest.testDefaultIfEmptyWithEmpty(rx.internal.operators.OperatorDefaultIfEmptyTest)
removed call to rx/Subscriber::setProducer → KILLED

4240

1.1
Location : switchIfEmpty
Killed by : rx.internal.operators.OperatorSwitchIfEmptyTest.testSwitchShouldTriggerUnsubscribe(rx.internal.operators.OperatorSwitchIfEmptyTest)
mutated return of Object value for rx/Observable::switchIfEmpty to ( if (x != null) null else throw new RuntimeException ) → KILLED

4274

1.1
Location : delay
Killed by : rx.internal.operators.OperatorDelayTest.testDelayWithObservableSubscriptionFunctionThrows(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED

4301

1.1
Location : delay
Killed by : rx.internal.operators.OperatorDelayTest.testDelayWithObservableDelayFunctionThrows(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED

4322

1.1
Location : delay
Killed by : rx.internal.operators.OnSubscribeAmbTest.testBackpressure(rx.internal.operators.OnSubscribeAmbTest)
mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED

4345

1.1
Location : delay
Killed by : rx.internal.operators.OperatorDelayTest.testErrorRunsBeforeOnNext(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::delay to ( if (x != null) null else throw new RuntimeException ) → KILLED

4365

1.1
Location : delaySubscription
Killed by : rx.internal.operators.OperatorDelayTest.testBackpressureWithSubscriptionTimedDelay(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED

4389

1.1
Location : delaySubscription
Killed by : rx.internal.operators.OperatorDelayTest.testDelaySubscriptionCancelBeforeTime(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED

4410

1.1
Location : delaySubscription
Killed by : rx.internal.operators.OperatorDelayTest.testDelayWithObservableSubscriptionFunctionThrows(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED

4433

1.1
Location : delaySubscription
Killed by : rx.CompletableTest.andThenNever(rx.CompletableTest)
negated conditional → KILLED

4436

1.1
Location : delaySubscription
Killed by : rx.CompletableTest.andThenNever(rx.CompletableTest)
mutated return of Object value for rx/Observable::delaySubscription to ( if (x != null) null else throw new RuntimeException ) → KILLED

4458

1.1
Location : dematerialize
Killed by : rx.internal.operators.OperatorDematerializeTest.testCompletePassThru(rx.internal.operators.OperatorDematerializeTest)
mutated return of Object value for rx/Observable::dematerialize to ( if (x != null) null else throw new RuntimeException ) → KILLED

4475

1.1
Location : distinct
Killed by : rx.internal.operators.OperatorDistinctTest.testDistinctOfNone(rx.internal.operators.OperatorDistinctTest)
mutated return of Object value for rx/Observable::distinct to ( if (x != null) null else throw new RuntimeException ) → KILLED

4495

1.1
Location : distinct
Killed by : rx.internal.operators.OperatorDistinctTest.testDistinctOfNoneWithKeySelector(rx.internal.operators.OperatorDistinctTest)
mutated return of Object value for rx/Observable::distinct to ( if (x != null) null else throw new RuntimeException ) → KILLED

4513

1.1
Location : distinctUntilChanged
Killed by : rx.internal.operators.OperatorDistinctUntilChangedTest.testDistinctUntilChangedOfNone(rx.internal.operators.OperatorDistinctUntilChangedTest)
mutated return of Object value for rx/Observable::distinctUntilChanged to ( if (x != null) null else throw new RuntimeException ) → KILLED

4534

1.1
Location : distinctUntilChanged
Killed by : rx.internal.operators.OperatorDistinctUntilChangedTest.testDistinctUntilChangedOfNoneWithKeySelector(rx.internal.operators.OperatorDistinctUntilChangedTest)
mutated return of Object value for rx/Observable::distinctUntilChanged to ( if (x != null) null else throw new RuntimeException ) → KILLED

4555

1.1
Location : onCompleted
Killed by : rx.ObservableDoOnTest.testDoOnCompleted(rx.ObservableDoOnTest)
removed call to rx/functions/Action0::call → KILLED

4568

1.1
Location : doOnCompleted
Killed by : rx.ObservableDoOnTest.testDoOnCompleted(rx.ObservableDoOnTest)
mutated return of Object value for rx/Observable::doOnCompleted to ( if (x != null) null else throw new RuntimeException ) → KILLED

4589

1.1
Location : onCompleted
Killed by : none
removed call to rx/functions/Action1::call → SURVIVED

4594

1.1
Location : onError
Killed by : none
removed call to rx/functions/Action1::call → SURVIVED

4599

1.1
Location : onNext
Killed by : rx.internal.operators.OnSubscribeCombineLatestTest.testWithCombineLatestIssue1717(rx.internal.operators.OnSubscribeCombineLatestTest)
removed call to rx/functions/Action1::call → KILLED

4604

1.1
Location : doOnEach
Killed by : rx.internal.operators.OperatorDelayTest.testDelayEmitsEverything(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::doOnEach to ( if (x != null) null else throw new RuntimeException ) → KILLED

4627

1.1
Location : doOnEach
Killed by : rx.internal.operators.OperatorDoOnEachTest.testDoOnEach(rx.internal.operators.OperatorDoOnEachTest)
mutated return of Object value for rx/Observable::doOnEach to ( if (x != null) null else throw new RuntimeException ) → KILLED

4655

1.1
Location : onError
Killed by : rx.internal.operators.OperatorDoOnEachTest.testOnErrorThrows(rx.internal.operators.OperatorDoOnEachTest)
removed call to rx/functions/Action1::call → KILLED

4664

1.1
Location : doOnError
Killed by : rx.internal.operators.OperatorDoOnEachTest.testOnErrorThrows(rx.internal.operators.OperatorDoOnEachTest)
mutated return of Object value for rx/Observable::doOnError to ( if (x != null) null else throw new RuntimeException ) → KILLED

4693

1.1
Location : onNext
Killed by : rx.internal.operators.OperatorIgnoreElementsTest.testDoesNotHangAndProcessesAllUsingBackpressure(rx.internal.operators.OperatorIgnoreElementsTest)
removed call to rx/functions/Action1::call → KILLED

4698

1.1
Location : doOnNext
Killed by : rx.internal.operators.OperatorIgnoreElementsTest.testDoesNotHangAndProcessesAllUsingBackpressure(rx.internal.operators.OperatorIgnoreElementsTest)
mutated return of Object value for rx/Observable::doOnNext to ( if (x != null) null else throw new RuntimeException ) → KILLED

4723

1.1
Location : doOnRequest
Killed by : rx.internal.operators.OperatorDoOnRequestTest.dontRequestIfDownstreamRequestsLate(rx.internal.operators.OperatorDoOnRequestTest)
mutated return of Object value for rx/Observable::doOnRequest to ( if (x != null) null else throw new RuntimeException ) → KILLED

4744

1.1
Location : doOnSubscribe
Killed by : rx.internal.operators.OperatorDoOnSubscribeTest.testDoOnSubscribe(rx.internal.operators.OperatorDoOnSubscribeTest)
mutated return of Object value for rx/Observable::doOnSubscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

4770

1.1
Location : onCompleted
Killed by : rx.internal.operators.OnSubscribeUsingTest.testUsingDisposesEagerlyBeforeCompletion(rx.internal.operators.OnSubscribeUsingTest)
removed call to rx/functions/Action0::call → KILLED

4775

1.1
Location : onError
Killed by : rx.internal.operators.OnSubscribeUsingTest.testUsingDisposesEagerlyBeforeError(rx.internal.operators.OnSubscribeUsingTest)
removed call to rx/functions/Action0::call → KILLED

4784

1.1
Location : doOnTerminate
Killed by : rx.internal.operators.OnSubscribeUsingTest.testUsingDisposesEagerlyBeforeCompletion(rx.internal.operators.OnSubscribeUsingTest)
mutated return of Object value for rx/Observable::doOnTerminate to ( if (x != null) null else throw new RuntimeException ) → KILLED

4805

1.1
Location : doOnUnsubscribe
Killed by : rx.internal.operators.OnSubscribeCompletableTest.testShouldUseUnsafeSubscribeInternallyNotSubscribe(rx.internal.operators.OnSubscribeCompletableTest)
mutated return of Object value for rx/Observable::doOnUnsubscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

4831

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testInnerEmpty(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

4861

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testEagerness3(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

4892

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testEagerness4(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

4925

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testEagerness5(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

4959

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testEagerness6(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

4995

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testEagerness7(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

5032

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testEagerness8(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

5071

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testEagerness9(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

5096

1.1
Location : concatEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testInnerEmpty(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

5122

1.1
Location : concatEager
Killed by : none
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5147

1.1
Location : concatEager
Killed by : none
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5173

1.1
Location : concatEager
Killed by : none
mutated return of Object value for rx/Observable::concatEager to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5199

1.1
Location : concatMapEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testMainError(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatMapEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

5226

1.1
Location : concatMapEager
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : concatMapEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testInvalidCapacityHint(rx.internal.operators.OperatorEagerConcatMapTest)
negated conditional → KILLED

5229

1.1
Location : concatMapEager
Killed by : rx.internal.operators.OperatorEagerConcatMapTest.testMainError(rx.internal.operators.OperatorEagerConcatMapTest)
mutated return of Object value for rx/Observable::concatMapEager to ( if (x != null) null else throw new RuntimeException ) → KILLED

5253

1.1
Location : elementAt
Killed by : rx.internal.operators.OperatorElementAtTest.testElementAtWithIndexOutOfBounds(rx.internal.operators.OperatorElementAtTest)
mutated return of Object value for rx/Observable::elementAt to ( if (x != null) null else throw new RuntimeException ) → KILLED

5277

1.1
Location : elementAtOrDefault
Killed by : rx.internal.operators.OperatorElementAtTest.testElementAtOrDefault(rx.internal.operators.OperatorElementAtTest)
mutated return of Object value for rx/Observable::elementAtOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED

5301

1.1
Location : exists
Killed by : rx.internal.operators.OperatorAnyTest.testBackpressureIfNoneRequestedNoneShouldBeDelivered(rx.internal.operators.OperatorAnyTest)
mutated return of Object value for rx/Observable::exists to ( if (x != null) null else throw new RuntimeException ) → KILLED

5321

1.1
Location : filter
Killed by : rx.internal.operators.OperatorFilterTest.testWithBackpressure(rx.internal.operators.OperatorFilterTest)
mutated return of Object value for rx/Observable::filter to ( if (x != null) null else throw new RuntimeException ) → KILLED

5344

1.1
Location : finallyDo
Killed by : none
mutated return of Object value for rx/Observable::finallyDo to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5365

1.1
Location : doAfterTerminate
Killed by : rx.internal.operators.OperatorDoAfterTerminateTest.testDoAfterTerminateCalledOnError(rx.internal.operators.OperatorDoAfterTerminateTest)
mutated return of Object value for rx/Observable::doAfterTerminate to ( if (x != null) null else throw new RuntimeException ) → KILLED

5383

1.1
Location : first
Killed by : rx.internal.operators.OperatorFirstTest.testFirstWithEmpty(rx.internal.operators.OperatorFirstTest)
mutated return of Object value for rx/Observable::first to ( if (x != null) null else throw new RuntimeException ) → KILLED

5403

1.1
Location : first
Killed by : rx.internal.operators.OperatorFirstTest.testFirstWithPredicate(rx.internal.operators.OperatorFirstTest)
mutated return of Object value for rx/Observable::first to ( if (x != null) null else throw new RuntimeException ) → KILLED

5423

1.1
Location : firstOrDefault
Killed by : rx.internal.operators.OperatorFirstTest.testFirstOrDefaultWithEmpty(rx.internal.operators.OperatorFirstTest)
mutated return of Object value for rx/Observable::firstOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED

5446

1.1
Location : firstOrDefault
Killed by : rx.internal.operators.OperatorFirstTest.testFirstOrDefaultWithPredicateAndEmpty(rx.internal.operators.OperatorFirstTest)
mutated return of Object value for rx/Observable::firstOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED

5469

1.1
Location : flatMap
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
negated conditional → KILLED

5470

1.1
Location : flatMap
Killed by : rx.internal.util.ScalarSynchronousObservableTest.syncFlatMapJustObserverNextThrows(rx.internal.util.ScalarSynchronousObservableTest)
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

5472

1.1
Location : flatMap
Killed by : rx.ObservableTests.testSubscribeWithoutOnError(rx.ObservableTests)
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

5500

1.1
Location : flatMap
Killed by : rx.internal.operators.OperatorFlatMapTest.testFlatMapMaxConcurrent(rx.internal.operators.OperatorFlatMapTest)
negated conditional → KILLED

5501

1.1
Location : flatMap
Killed by : none
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5503

1.1
Location : flatMap
Killed by : rx.internal.operators.OperatorFlatMapTest.testFlatMapMaxConcurrent(rx.internal.operators.OperatorFlatMapTest)
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

5534

1.1
Location : flatMap
Killed by : rx.internal.operators.OperatorFlatMapTest.testFlatMapTransformsOnCompletedFuncThrows(rx.internal.operators.OperatorFlatMapTest)
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

5569

1.1
Location : flatMap
Killed by : rx.internal.operators.OperatorFlatMapTest.testFlatMapTransformsMaxConcurrentNormal(rx.internal.operators.OperatorFlatMapTest)
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

5597

1.1
Location : flatMap
Killed by : rx.internal.operators.OperatorFlatMapTest.testCollectionFunctionThrows(rx.internal.operators.OperatorFlatMapTest)
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

5629

1.1
Location : flatMap
Killed by : rx.internal.operators.OperatorFlatMapTest.testFlatMapSelectorMaxConcurrent(rx.internal.operators.OperatorFlatMapTest)
mutated return of Object value for rx/Observable::flatMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

5652

1.1
Location : flatMapIterable
Killed by : none
mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5682

1.1
Location : flatMapIterable
Killed by : none
mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5711

1.1
Location : flatMapIterable
Killed by : rx.internal.operators.OperatorFlatMapTest.testCollectionFunctionThrows(rx.internal.operators.OperatorFlatMapTest)
mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → KILLED

5747

1.1
Location : flatMapIterable
Killed by : none
mutated return of Object value for rx/Observable::flatMapIterable to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

5854

1.1
Location : groupBy
Killed by : rx.internal.operators.OperatorGroupByTest.keySelectorThrows(rx.internal.operators.OperatorGroupByTest)
mutated return of Object value for rx/Observable::groupBy to ( if (x != null) null else throw new RuntimeException ) → KILLED

5885

1.1
Location : groupBy
Killed by : rx.internal.operators.OperatorGroupByTest.testGroupByOnAsynchronousSourceAcceptsMultipleSubscriptions(rx.internal.operators.OperatorGroupByTest)
mutated return of Object value for rx/Observable::groupBy to ( if (x != null) null else throw new RuntimeException ) → KILLED

5915

1.1
Location : groupJoin
Killed by : rx.internal.operators.OnSubscribeGroupJoinTest.rightDurationSelectorThrows(rx.internal.operators.OnSubscribeGroupJoinTest)
mutated return of Object value for rx/Observable::groupJoin to ( if (x != null) null else throw new RuntimeException ) → KILLED

5932

1.1
Location : ignoreElements
Killed by : rx.internal.operators.OperatorIgnoreElementsTest.testErrorReceived(rx.internal.operators.OperatorIgnoreElementsTest)
mutated return of Object value for rx/Observable::ignoreElements to ( if (x != null) null else throw new RuntimeException ) → KILLED

5952

1.1
Location : isEmpty
Killed by : rx.internal.operators.OperatorIgnoreElementsTest.testWithEmpty(rx.internal.operators.OperatorIgnoreElementsTest)
mutated return of Object value for rx/Observable::isEmpty to ( if (x != null) null else throw new RuntimeException ) → KILLED

5986

1.1
Location : join
Killed by : rx.internal.operators.OnSubscribeJoinTest.rightDurationSelectorThrows(rx.internal.operators.OnSubscribeJoinTest)
mutated return of Object value for rx/Observable::join to ( if (x != null) null else throw new RuntimeException ) → KILLED

6004

1.1
Location : last
Killed by : rx.internal.operators.OnSubscribeUsingTest.testUsingWithResourceFactoryError(rx.internal.operators.OnSubscribeUsingTest)
mutated return of Object value for rx/Observable::last to ( if (x != null) null else throw new RuntimeException ) → KILLED

6026

1.1
Location : last
Killed by : rx.internal.operators.OperatorLastTest.testLastWithPredicateAndEmpty(rx.internal.operators.OperatorLastTest)
mutated return of Object value for rx/Observable::last to ( if (x != null) null else throw new RuntimeException ) → KILLED

6046

1.1
Location : lastOrDefault
Killed by : rx.observables.BlockingObservableTest.testLastOrDefault2(rx.observables.BlockingObservableTest)
mutated return of Object value for rx/Observable::lastOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED

6069

1.1
Location : lastOrDefault
Killed by : rx.internal.operators.OperatorLastTest.testLastOrDefaultWithPredicateAndEmpty(rx.internal.operators.OperatorLastTest)
mutated return of Object value for rx/Observable::lastOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED

6094

1.1
Location : limit
Killed by : none
mutated return of Object value for rx/Observable::limit to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

6114

1.1
Location : map
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
mutated return of Object value for rx/Observable::map to ( if (x != null) null else throw new RuntimeException ) → KILLED

6118

1.1
Location : mapNotification
Killed by : rx.internal.operators.OperatorFlatMapTest.testFlatMapTransformsOnCompletedFuncThrows(rx.internal.operators.OperatorFlatMapTest)
mutated return of Object value for rx/Observable::mapNotification to ( if (x != null) null else throw new RuntimeException ) → KILLED

6136

1.1
Location : materialize
Killed by : rx.internal.operators.OperatorMaterializeTest.testUnsubscribeJustBeforeCompletionNotificationShouldPreventThatNotificationArriving(rx.internal.operators.OperatorMaterializeTest)
mutated return of Object value for rx/Observable::materialize to ( if (x != null) null else throw new RuntimeException ) → KILLED

6157

1.1
Location : mergeWith
Killed by : rx.ObservableTests.testMergeWith(rx.ObservableTests)
mutated return of Object value for rx/Observable::mergeWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

6182

1.1
Location : observeOn
Killed by : rx.internal.operators.OperatorObserveOnTest.testObserveOn(rx.internal.operators.OperatorObserveOnTest)
negated conditional → KILLED

6183

1.1
Location : observeOn
Killed by : rx.observables.BlockingObservableTest.testRun(rx.observables.BlockingObservableTest)
mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED

6185

1.1
Location : observeOn
Killed by : rx.internal.operators.OperatorObserveOnTest.testObserveOn(rx.internal.operators.OperatorObserveOnTest)
mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED

6212

1.1
Location : observeOn
Killed by : rx.internal.operators.OperatorObserveOnTest.testErrorDelayed(rx.internal.operators.OperatorObserveOnTest)
negated conditional → KILLED

6213

1.1
Location : observeOn
Killed by : none
mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6215

1.1
Location : observeOn
Killed by : rx.internal.operators.OperatorObserveOnTest.testErrorDelayed(rx.internal.operators.OperatorObserveOnTest)
mutated return of Object value for rx/Observable::observeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED

6233

1.1
Location : ofType
Killed by : rx.ObservableTests.testOfTypeWithPolymorphism(rx.ObservableTests)
mutated return of Object value for rx/Observable::ofType to ( if (x != null) null else throw new RuntimeException ) → KILLED

6236

1.1
Location : call
Killed by : rx.ObservableTests.testOfTypeWithPolymorphism(rx.ObservableTests)
mutated return of Object value for rx/Observable$13::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

6255

1.1
Location : onBackpressureBuffer
Killed by : rx.internal.operators.OperatorOnBackpressureBufferTest.testFixBackpressureWithBuffer(rx.internal.operators.OperatorOnBackpressureBufferTest)
mutated return of Object value for rx/Observable::onBackpressureBuffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

6275

1.1
Location : onBackpressureBuffer
Killed by : none
mutated return of Object value for rx/Observable::onBackpressureBuffer to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

6295

1.1
Location : onBackpressureBuffer
Killed by : rx.internal.operators.OperatorOnBackpressureBufferTest.testNonFatalExceptionThrownByOnOverflowIsNotReportedByUpstream(rx.internal.operators.OperatorOnBackpressureBufferTest)
mutated return of Object value for rx/Observable::onBackpressureBuffer to ( if (x != null) null else throw new RuntimeException ) → KILLED

6318

1.1
Location : onBackpressureDrop
Killed by : rx.internal.operators.OperatorOnBackpressureDropTest.testNonFatalExceptionFromOverflowActionIsNotReportedFromUpstreamOperator(rx.internal.operators.OperatorOnBackpressureDropTest)
mutated return of Object value for rx/Observable::onBackpressureDrop to ( if (x != null) null else throw new RuntimeException ) → KILLED

6338

1.1
Location : onBackpressureDrop
Killed by : rx.internal.operators.OperatorOnBackpressureDropTest.testRequestOverflow(rx.internal.operators.OperatorOnBackpressureDropTest)
mutated return of Object value for rx/Observable::onBackpressureDrop to ( if (x != null) null else throw new RuntimeException ) → KILLED

6360

1.1
Location : onBackpressureLatest
Killed by : rx.internal.operators.OperatorOnBackpressureLatestTest.testSimpleBackpressure(rx.internal.operators.OperatorOnBackpressureLatestTest)
mutated return of Object value for rx/Observable::onBackpressureLatest to ( if (x != null) null else throw new RuntimeException ) → KILLED

6393

1.1
Location : onErrorResumeNext
Killed by : rx.internal.operators.OperatorOnErrorResumeNextViaFunctionTest.testOnErrorResumeReceivesErrorFromPreviousNonProtectedOperator(rx.internal.operators.OperatorOnErrorResumeNextViaFunctionTest)
mutated return of Object value for rx/Observable::onErrorResumeNext to ( if (x != null) null else throw new RuntimeException ) → KILLED

6426

1.1
Location : onErrorResumeNext
Killed by : rx.internal.operators.OperatorOnErrorResumeNextViaObservableTest.testResumeNextWithFailedOnSubscribe(rx.internal.operators.OperatorOnErrorResumeNextViaObservableTest)
mutated return of Object value for rx/Observable::onErrorResumeNext to ( if (x != null) null else throw new RuntimeException ) → KILLED

6456

1.1
Location : onErrorReturn
Killed by : rx.internal.operators.OperatorOnErrorReturnTest.testFunctionThrowsError(rx.internal.operators.OperatorOnErrorReturnTest)
mutated return of Object value for rx/Observable::onErrorReturn to ( if (x != null) null else throw new RuntimeException ) → KILLED

6492

1.1
Location : onExceptionResumeNext
Killed by : rx.internal.operators.OperatorOnExceptionResumeNextViaObservableTest.testResumeNextWithRuntimeException(rx.internal.operators.OperatorOnExceptionResumeNextViaObservableTest)
mutated return of Object value for rx/Observable::onExceptionResumeNext to ( if (x != null) null else throw new RuntimeException ) → KILLED

6511

1.1
Location : publish
Killed by : rx.internal.operators.OperatorPublishTest.testNonNullConnection(rx.internal.operators.OperatorPublishTest)
mutated return of Object value for rx/Observable::publish to ( if (x != null) null else throw new RuntimeException ) → KILLED

6534

1.1
Location : publish
Killed by : rx.internal.operators.OperatorPublishFunctionTest.oneStartOnly(rx.internal.operators.OperatorPublishFunctionTest)
mutated return of Object value for rx/Observable::publish to ( if (x != null) null else throw new RuntimeException ) → KILLED

6573

1.1
Location : reduce
Killed by : rx.ReduceTests.reduceInts(rx.ReduceTests)
mutated return of Object value for rx/Observable::reduce to ( if (x != null) null else throw new RuntimeException ) → KILLED

6606

1.1
Location : reduce
Killed by : rx.ObservableTests.testCountError(rx.ObservableTests)
mutated return of Object value for rx/Observable::reduce to ( if (x != null) null else throw new RuntimeException ) → KILLED

6622

1.1
Location : repeat
Killed by : rx.CompletableTest.repeatError(rx.CompletableTest)
mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → KILLED

6641

1.1
Location : repeat
Killed by : rx.internal.operators.OperatorRepeatTest.testRepetition(rx.internal.operators.OperatorRepeatTest)
mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → KILLED

6664

1.1
Location : repeat
Killed by : rx.CompletableTest.repeat0Time(rx.CompletableTest)
mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → KILLED

6687

1.1
Location : repeat
Killed by : none
mutated return of Object value for rx/Observable::repeat to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6715

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$14::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6718

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$14$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6723

1.1
Location : repeatWhen
Killed by : none
mutated return of Object value for rx/Observable::repeatWhen to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6749

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$15::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6752

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$15$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6757

1.1
Location : repeatWhen
Killed by : none
mutated return of Object value for rx/Observable::repeatWhen to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6781

1.1
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testCache(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED

6808

1.1
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testSynchronousDisconnect(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED

6811

1.1
Location : call
Killed by : rx.internal.operators.OperatorReplayTest.testSynchronousDisconnect(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable$16::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

6844

1.1
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testBufferedReplaySelector(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED

6847

1.1
Location : call
Killed by : rx.internal.operators.OperatorReplayTest.testBufferedReplaySelector(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable$17::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

6885

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6925

1.1
Location : replay
Killed by : none
changed conditional boundary → NO_COVERAGE

2.2
Location : replay
Killed by : none
negated conditional → NO_COVERAGE

6928

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6931

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$18::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6966

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6969

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$19::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

6974

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$20::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7009

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7044

1.1
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testWindowedReplaySelector(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED

7047

1.1
Location : call
Killed by : rx.internal.operators.OperatorReplayTest.testWindowedReplaySelector(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable$21::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

7079

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7082

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$22::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7087

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$23::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7115

1.1
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testBackpressureBounded(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED

7146

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7181

1.1
Location : replay
Killed by : none
changed conditional boundary → SURVIVED

2.2
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testBufferedWindowReplay(rx.internal.operators.OperatorReplayTest)
negated conditional → KILLED

7184

1.1
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testBufferedWindowReplay(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED

7212

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7240

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7270

1.1
Location : replay
Killed by : rx.internal.operators.OperatorReplayTest.testWindowedReplay(rx.internal.operators.OperatorReplayTest)
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → KILLED

7297

1.1
Location : replay
Killed by : none
mutated return of Object value for rx/Observable::replay to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7322

1.1
Location : retry
Killed by : rx.internal.operators.OperatorRetryTest.testUnsubscribeFromRetry(rx.internal.operators.OperatorRetryTest)
mutated return of Object value for rx/Observable::retry to ( if (x != null) null else throw new RuntimeException ) → KILLED

7350

1.1
Location : retry
Killed by : rx.internal.operators.OperatorRetryTest.testSourceObservableRetry0(rx.internal.operators.OperatorRetryTest)
mutated return of Object value for rx/Observable::retry to ( if (x != null) null else throw new RuntimeException ) → KILLED

7373

1.1
Location : retry
Killed by : rx.internal.operators.OperatorRetryWithPredicateTest.testUnsubscribeFromRetry(rx.internal.operators.OperatorRetryWithPredicateTest)
mutated return of Object value for rx/Observable::retry to ( if (x != null) null else throw new RuntimeException ) → KILLED

7428

1.1
Location : call
Killed by : rx.internal.operators.OperatorRetryTest.testOnCompletedFromNotificationHandler(rx.internal.operators.OperatorRetryTest)
mutated return of Object value for rx/Observable$24::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

7431

1.1
Location : call
Killed by : rx.SingleTest.testRetryWhen(rx.SingleTest)
mutated return of Object value for rx/Observable$24$1::call to ( if (x != null) null else throw new RuntimeException ) → KILLED

7436

1.1
Location : retryWhen
Killed by : rx.internal.operators.OperatorRetryTest.testOnCompletedFromNotificationHandler(rx.internal.operators.OperatorRetryTest)
mutated return of Object value for rx/Observable::retryWhen to ( if (x != null) null else throw new RuntimeException ) → KILLED

7466

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$25::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7469

1.1
Location : call
Killed by : none
mutated return of Object value for rx/Observable$25$1::call to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7474

1.1
Location : retryWhen
Killed by : none
mutated return of Object value for rx/Observable::retryWhen to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7500

1.1
Location : sample
Killed by : rx.internal.operators.OperatorSampleTest.testSampleUnsubscribe(rx.internal.operators.OperatorSampleTest)
mutated return of Object value for rx/Observable::sample to ( if (x != null) null else throw new RuntimeException ) → KILLED

7528

1.1
Location : sample
Killed by : rx.internal.operators.OperatorSampleTest.testSampleUnsubscribe(rx.internal.operators.OperatorSampleTest)
mutated return of Object value for rx/Observable::sample to ( if (x != null) null else throw new RuntimeException ) → KILLED

7553

1.1
Location : sample
Killed by : rx.internal.operators.OperatorSampleTest.testSampleOtherUnboundedIn(rx.internal.operators.OperatorSampleTest)
mutated return of Object value for rx/Observable::sample to ( if (x != null) null else throw new RuntimeException ) → KILLED

7578

1.1
Location : scan
Killed by : rx.ReduceTests.reduceCovariance(rx.ReduceTests)
mutated return of Object value for rx/Observable::scan to ( if (x != null) null else throw new RuntimeException ) → KILLED

7609

1.1
Location : scan
Killed by : rx.internal.operators.OperatorScanTest.testBackpressureWithInitialValue(rx.internal.operators.OperatorScanTest)
mutated return of Object value for rx/Observable::scan to ( if (x != null) null else throw new RuntimeException ) → KILLED

7633

1.1
Location : serialize
Killed by : rx.internal.operators.OperatorSerializeTest.testSingleThreadedBasic(rx.internal.operators.OperatorSerializeTest)
mutated return of Object value for rx/Observable::serialize to ( if (x != null) null else throw new RuntimeException ) → KILLED

7658

1.1
Location : share
Killed by : rx.internal.operators.OperatorPublishTest.testBackpressureTwoConsumers(rx.internal.operators.OperatorPublishTest)
mutated return of Object value for rx/Observable::share to ( if (x != null) null else throw new RuntimeException ) → KILLED

7680

1.1
Location : single
Killed by : rx.internal.operators.BlockingOperatorToFutureTest.testGetAfterCancel(rx.internal.operators.BlockingOperatorToFutureTest)
mutated return of Object value for rx/Observable::single to ( if (x != null) null else throw new RuntimeException ) → KILLED

7706

1.1
Location : single
Killed by : rx.internal.operators.OperatorSingleTest.testSingleWithPredicate(rx.internal.operators.OperatorSingleTest)
mutated return of Object value for rx/Observable::single to ( if (x != null) null else throw new RuntimeException ) → KILLED

7729

1.1
Location : singleOrDefault
Killed by : rx.internal.operators.OperatorSingleTest.testSingleOrDefaultWithEmpty(rx.internal.operators.OperatorSingleTest)
mutated return of Object value for rx/Observable::singleOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED

7755

1.1
Location : singleOrDefault
Killed by : rx.internal.operators.OperatorSingleTest.testSingleOrDefaultWithPredicateAndEmpty(rx.internal.operators.OperatorSingleTest)
mutated return of Object value for rx/Observable::singleOrDefault to ( if (x != null) null else throw new RuntimeException ) → KILLED

7775

1.1
Location : skip
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
mutated return of Object value for rx/Observable::skip to ( if (x != null) null else throw new RuntimeException ) → KILLED

7797

1.1
Location : skip
Killed by : none
mutated return of Object value for rx/Observable::skip to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7821

1.1
Location : skip
Killed by : rx.internal.operators.OperatorSkipTimedTest.testSkipTimedFinishBeforeTime(rx.internal.operators.OperatorSkipTimedTest)
mutated return of Object value for rx/Observable::skip to ( if (x != null) null else throw new RuntimeException ) → KILLED

7847

1.1
Location : skipLast
Killed by : rx.internal.operators.OperatorSkipLastTest.testSkipLastEmpty(rx.internal.operators.OperatorSkipLastTest)
mutated return of Object value for rx/Observable::skipLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

7871

1.1
Location : skipLast
Killed by : none
mutated return of Object value for rx/Observable::skipLast to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

7897

1.1
Location : skipLast
Killed by : rx.internal.operators.OperatorSkipLastTimedTest.testSkipLastTimedCompleteBeforeTime(rx.internal.operators.OperatorSkipLastTimedTest)
mutated return of Object value for rx/Observable::skipLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

7918

1.1
Location : skipUntil
Killed by : rx.internal.operators.OperatorSkipUntilTest.otherEmpty(rx.internal.operators.OperatorSkipUntilTest)
mutated return of Object value for rx/Observable::skipUntil to ( if (x != null) null else throw new RuntimeException ) → KILLED

7938

1.1
Location : skipWhile
Killed by : rx.internal.operators.OperatorSkipWhileTest.testPredicateFatalError(rx.internal.operators.OperatorSkipWhileTest)
mutated return of Object value for rx/Observable::skipWhile to ( if (x != null) null else throw new RuntimeException ) → KILLED

7958

1.1
Location : startWith
Killed by : rx.CompletableTest.startWithFlowableError(rx.CompletableTest)
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

7978

1.1
Location : startWith
Killed by : rx.StartWithTests.startWithIterable(rx.StartWithTests)
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

7998

1.1
Location : startWith
Killed by : rx.CovarianceTest.testComposeWithDeltaLogic(rx.CovarianceTest)
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

8020

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8044

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8070

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8098

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8128

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8160

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8194

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8230

1.1
Location : startWith
Killed by : none
mutated return of Object value for rx/Observable::startWith to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8248

1.1
Location : subscribe
Killed by : rx.subjects.ReplaySubjectTest.testSubscriptionLeak(rx.subjects.ReplaySubjectTest)
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

8286

1.1
Location : subscribe
Killed by : rx.ObservableTests.testForEachWithNull(rx.ObservableTests)
negated conditional → KILLED

8290

1.1
Location : subscribe
Killed by : rx.internal.operators.OperatorRetryWithPredicateTest.testUnsubscribeFromRetry(rx.internal.operators.OperatorRetryWithPredicateTest)
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

8304

1.1
Location : onNext
Killed by : rx.internal.operators.OperatorTakeTest.testUnsubscribeFromSynchronousInfiniteObservable(rx.internal.operators.OperatorTakeTest)
removed call to rx/functions/Action1::call → KILLED

8331

1.1
Location : subscribe
Killed by : rx.internal.operators.OnSubscribeRefCountTest.testUpstreamErrorAllowsRetry(rx.internal.operators.OnSubscribeRefCountTest)
negated conditional → KILLED

8334

1.1
Location : subscribe
Killed by : rx.internal.operators.OnSubscribeRefCountTest.testUpstreamErrorAllowsRetry(rx.internal.operators.OnSubscribeRefCountTest)
negated conditional → KILLED

8338

1.1
Location : subscribe
Killed by : none
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

8347

1.1
Location : onError
Killed by : none
removed call to rx/functions/Action1::call → SURVIVED

8352

1.1
Location : onNext
Killed by : none
removed call to rx/functions/Action1::call → NO_COVERAGE

8383

1.1
Location : subscribe
Killed by : rx.internal.operators.OperatorReplayTest.testSynchronousDisconnect(rx.internal.operators.OperatorReplayTest)
negated conditional → KILLED

8386

1.1
Location : subscribe
Killed by : rx.internal.operators.OperatorReplayTest.testSynchronousDisconnect(rx.internal.operators.OperatorReplayTest)
negated conditional → KILLED

8389

1.1
Location : subscribe
Killed by : rx.internal.operators.OperatorReplayTest.testSynchronousDisconnect(rx.internal.operators.OperatorReplayTest)
negated conditional → KILLED

8393

1.1
Location : subscribe
Killed by : none
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

8397

1.1
Location : onCompleted
Killed by : none
removed call to rx/functions/Action0::call → SURVIVED

8402

1.1
Location : onError
Killed by : none
removed call to rx/functions/Action1::call → NO_COVERAGE

8407

1.1
Location : onNext
Killed by : none
removed call to rx/functions/Action1::call → SURVIVED

8428

1.1
Location : subscribe
Killed by : rx.observers.TestObserverTest.testErrorSwallowed(rx.observers.TestObserverTest)
negated conditional → KILLED

8429

1.1
Location : subscribe
Killed by : rx.ObservableTests.testSubscribingSubscriberAsObserverMaintainsSubscriptionChain(rx.ObservableTests)
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

8431

1.1
Location : subscribe
Killed by : rx.internal.operators.OperatorDelayTest.testDelaySubscriptionCancelBeforeTime(rx.internal.operators.OperatorDelayTest)
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

8435

1.1
Location : onCompleted
Killed by : rx.internal.operators.OperatorDistinctTest.testDistinctOfNoneWithKeySelector(rx.internal.operators.OperatorDistinctTest)
removed call to rx/Observer::onCompleted → KILLED

8440

1.1
Location : onError
Killed by : rx.exceptions.ExceptionsTest.testOnErrorExceptionIsThrown(rx.exceptions.ExceptionsTest)
removed call to rx/Observer::onError → KILLED

8445

1.1
Location : onNext
Killed by : rx.exceptions.ExceptionsTest.testThreadDeathIsThrown(rx.exceptions.ExceptionsTest)
removed call to rx/Observer::onNext → KILLED

8472

1.1
Location : unsafeSubscribe
Killed by : rx.SubscriberTest.testOnStartCalledOnceViaUnsafeSubscribe(rx.SubscriberTest)
removed call to rx/Subscriber::onStart → KILLED

8474

1.1
Location : unsafeSubscribe
Killed by : rx.CompletableTest.fromObservableError(rx.CompletableTest)
removed call to rx/Observable$OnSubscribe::call → KILLED

8475

1.1
Location : unsafeSubscribe
Killed by : rx.internal.operators.OperatorTimeoutWithSelectorTest.testTimeoutSelectorWithFirstTimeoutFirstAndNoOtherObservable(rx.internal.operators.OperatorTimeoutWithSelectorTest)
mutated return of Object value for rx/Observable::unsafeSubscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

8478

1.1
Location : unsafeSubscribe
Killed by : rx.internal.operators.OperatorSkipWhileTest.testPredicateFatalError(rx.internal.operators.OperatorSkipWhileTest)
removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED

8481

1.1
Location : unsafeSubscribe
Killed by : rx.exceptions.ExceptionsTest.testOnErrorExceptionIsThrownFromUnsafeSubscribe(rx.exceptions.ExceptionsTest)
removed call to rx/Subscriber::onError → KILLED

8483

1.1
Location : unsafeSubscribe
Killed by : rx.exceptions.ExceptionsTest.testOnErrorExceptionIsThrownFromUnsafeSubscribe(rx.exceptions.ExceptionsTest)
removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED

8492

1.1
Location : unsafeSubscribe
Killed by : none
mutated return of Object value for rx/Observable::unsafeSubscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

8534

1.1
Location : subscribe
Killed by : rx.ObservableTests.testSubscribingSubscriberAsObserverMaintainsSubscriptionChain(rx.ObservableTests)
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

8539

1.1
Location : subscribe
Killed by : rx.schedulers.ExecutorSchedulerTest.testConcurrentOnNextFailsValidation(rx.schedulers.ExecutorSchedulerTest)
negated conditional → KILLED

8542

1.1
Location : subscribe
Killed by : rx.schedulers.ExecutorSchedulerTest.testConcurrentOnNextFailsValidation(rx.schedulers.ExecutorSchedulerTest)
negated conditional → KILLED

8551

1.1
Location : subscribe
Killed by : rx.internal.operators.OperatorAllTest.testBackpressureIfNoneRequestedNoneShouldBeDelivered(rx.internal.operators.OperatorAllTest)
removed call to rx/Subscriber::onStart → KILLED

8558

1.1
Location : subscribe
Killed by : rx.plugins.RxJavaPluginsTest.testOnErrorWhenImplementedViaSubscribe(rx.plugins.RxJavaPluginsTest)
negated conditional → KILLED

8567

1.1
Location : subscribe
Killed by : rx.schedulers.ExecutorSchedulerTest.testConcurrentOnNextFailsValidation(rx.schedulers.ExecutorSchedulerTest)
removed call to rx/Observable$OnSubscribe::call → KILLED

8568

1.1
Location : subscribe
Killed by : rx.ObservableTests.testSubscribingSubscriberAsObserverMaintainsSubscriptionChain(rx.ObservableTests)
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → KILLED

8571

1.1
Location : subscribe
Killed by : none
removed call to rx/exceptions/Exceptions::throwIfFatal → SURVIVED

8574

1.1
Location : subscribe
Killed by : rx.ObservableTests.testCustomObservableWithErrorInObservableSynchronous(rx.ObservableTests)
removed call to rx/Subscriber::onError → KILLED

8576

1.1
Location : subscribe
Killed by : rx.exceptions.ExceptionsTest.testOnErrorExceptionIsThrownFromSubscribe(rx.exceptions.ExceptionsTest)
removed call to rx/exceptions/Exceptions::throwIfFatal → KILLED

8585

1.1
Location : subscribe
Killed by : none
mutated return of Object value for rx/Observable::subscribe to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

8607

1.1
Location : subscribeOn
Killed by : rx.internal.util.BlockingUtilsTest.awaitCompleteShouldReturnOnEmpty(rx.internal.util.BlockingUtilsTest)
negated conditional → KILLED

8608

1.1
Location : subscribeOn
Killed by : rx.internal.util.ScalarSynchronousObservableTest.asyncObserverNextThrows(rx.internal.util.ScalarSynchronousObservableTest)
mutated return of Object value for rx/Observable::subscribeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED

8610

1.1
Location : subscribeOn
Killed by : rx.internal.util.BlockingUtilsTest.awaitCompleteShouldReturnOnEmpty(rx.internal.util.BlockingUtilsTest)
mutated return of Object value for rx/Observable::subscribeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED

8631

1.1
Location : switchMap
Killed by : rx.internal.operators.OperatorSwitchTest.testIssue2654(rx.internal.operators.OperatorSwitchTest)
mutated return of Object value for rx/Observable::switchMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

8655

1.1
Location : take
Killed by : rx.SubscriberTest.testRequestThroughTakeThatReducesRequest(rx.SubscriberTest)
mutated return of Object value for rx/Observable::take to ( if (x != null) null else throw new RuntimeException ) → KILLED

8676

1.1
Location : take
Killed by : none
mutated return of Object value for rx/Observable::take to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8700

1.1
Location : take
Killed by : rx.internal.operators.OperatorTakeTimedTest.testTakeTimedErrorAfterTime(rx.internal.operators.OperatorTakeTimedTest)
mutated return of Object value for rx/Observable::take to ( if (x != null) null else throw new RuntimeException ) → KILLED

8721

1.1
Location : takeFirst
Killed by : rx.internal.operators.OperatorFirstTest.testFirstOrDefaultWithPredicateAndEmpty(rx.internal.operators.OperatorFirstTest)
mutated return of Object value for rx/Observable::takeFirst to ( if (x != null) null else throw new RuntimeException ) → KILLED

8743

1.1
Location : takeLast
Killed by : rx.internal.operators.OperatorTakeLastTest.testTakeLastWithNegativeCount(rx.internal.operators.OperatorTakeLastTest)
negated conditional → KILLED

8744

1.1
Location : takeLast
Killed by : rx.internal.operators.OperatorTakeLastTest.testTakeLastWithZeroCount(rx.internal.operators.OperatorTakeLastTest)
mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

8745

1.1
Location : takeLast
Killed by : rx.internal.operators.OperatorTakeLastTest.testTakeLastWithNegativeCount(rx.internal.operators.OperatorTakeLastTest)
negated conditional → KILLED

8746

1.1
Location : takeLast
Killed by : rx.internal.operators.OperatorLastTest.testLastViaObservable(rx.internal.operators.OperatorLastTest)
mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

8748

1.1
Location : takeLast
Killed by : rx.internal.operators.OperatorTakeLastTest.testTakeLastEmpty(rx.internal.operators.OperatorTakeLastTest)
mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

8772

1.1
Location : takeLast
Killed by : none
mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → SURVIVED

8802

1.1
Location : takeLast
Killed by : rx.internal.operators.OperatorTakeLastTimedTest.takeLastTimedWithZeroCapacity(rx.internal.operators.OperatorTakeLastTimedTest)
mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

8824

1.1
Location : takeLast
Killed by : none
mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8850

1.1
Location : takeLast
Killed by : rx.internal.operators.OperatorTakeLastTimedTest.takeLastTimedDelayCompletion(rx.internal.operators.OperatorTakeLastTimedTest)
mutated return of Object value for rx/Observable::takeLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

8870

1.1
Location : takeLastBuffer
Killed by : none
mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8895

1.1
Location : takeLastBuffer
Killed by : none
mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8923

1.1
Location : takeLastBuffer
Killed by : none
mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8945

1.1
Location : takeLastBuffer
Killed by : none
mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8971

1.1
Location : takeLastBuffer
Killed by : none
mutated return of Object value for rx/Observable::takeLastBuffer to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

8993

1.1
Location : takeUntil
Killed by : rx.internal.operators.OperatorTakeUntilTest.testTakeUntilOtherCompleted(rx.internal.operators.OperatorTakeUntilTest)
mutated return of Object value for rx/Observable::takeUntil to ( if (x != null) null else throw new RuntimeException ) → KILLED

9014

1.1
Location : takeWhile
Killed by : rx.internal.operators.OperatorTakeWhileTest.testNoUnsubscribeDownstream(rx.internal.operators.OperatorTakeWhileTest)
mutated return of Object value for rx/Observable::takeWhile to ( if (x != null) null else throw new RuntimeException ) → KILLED

9036

1.1
Location : takeUntil
Killed by : rx.internal.operators.OperatorTakeUntilPredicateTest.takeEmpty(rx.internal.operators.OperatorTakeUntilPredicateTest)
mutated return of Object value for rx/Observable::takeUntil to ( if (x != null) null else throw new RuntimeException ) → KILLED

9063

1.1
Location : throttleFirst
Killed by : none
mutated return of Object value for rx/Observable::throttleFirst to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9093

1.1
Location : throttleFirst
Killed by : rx.internal.operators.OperatorThrottleFirstTest.testThrottlingWithCompleted(rx.internal.operators.OperatorThrottleFirstTest)
mutated return of Object value for rx/Observable::throttleFirst to ( if (x != null) null else throw new RuntimeException ) → KILLED

9122

1.1
Location : throttleLast
Killed by : rx.internal.operators.OperatorSampleTest.testSampleUnsubscribe(rx.internal.operators.OperatorSampleTest)
mutated return of Object value for rx/Observable::throttleLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

9154

1.1
Location : throttleLast
Killed by : rx.ThrottleLastTests.testThrottle(rx.ThrottleLastTests)
mutated return of Object value for rx/Observable::throttleLast to ( if (x != null) null else throw new RuntimeException ) → KILLED

9192

1.1
Location : throttleWithTimeout
Killed by : none
mutated return of Object value for rx/Observable::throttleWithTimeout to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9234

1.1
Location : throttleWithTimeout
Killed by : rx.ThrottleWithTimeoutTests.testThrottle(rx.ThrottleWithTimeoutTests)
mutated return of Object value for rx/Observable::throttleWithTimeout to ( if (x != null) null else throw new RuntimeException ) → KILLED

9251

1.1
Location : timeInterval
Killed by : none
mutated return of Object value for rx/Observable::timeInterval to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9270

1.1
Location : timeInterval
Killed by : rx.internal.operators.OperatorTimeIntervalTest.testTimeInterval(rx.internal.operators.OperatorTimeIntervalTest)
mutated return of Object value for rx/Observable::timeInterval to ( if (x != null) null else throw new RuntimeException ) → KILLED

9301

1.1
Location : timeout
Killed by : rx.internal.operators.OperatorTimeoutWithSelectorTest.testTimeoutSelectorWithFirstTimeoutFirstAndNoOtherObservable(rx.internal.operators.OperatorTimeoutWithSelectorTest)
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED

9336

1.1
Location : timeout
Killed by : rx.internal.operators.OperatorTimeoutWithSelectorTest.testTimeoutSelectorFirstThrows(rx.internal.operators.OperatorTimeoutWithSelectorTest)
negated conditional → KILLED

9339

1.1
Location : timeout
Killed by : rx.internal.operators.OperatorTimeoutWithSelectorTest.testTimeoutSelectorFirstThrows(rx.internal.operators.OperatorTimeoutWithSelectorTest)
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED

9367

1.1
Location : timeout
Killed by : none
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9397

1.1
Location : timeout
Killed by : none
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → TIMED_OUT

9420

1.1
Location : timeout
Killed by : rx.plugins.RxJavaPluginsTest.testOnNextValueCallsPlugin(rx.plugins.RxJavaPluginsTest)
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED

9444

1.1
Location : timeout
Killed by : none
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9471

1.1
Location : timeout
Killed by : rx.internal.operators.OperatorTimeoutTests.shouldUnsubscribeFromUnderlyingSubscriptionOnImmediatelyComplete(rx.internal.operators.OperatorTimeoutTests)
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED

9497

1.1
Location : timeout
Killed by : rx.internal.operators.OperatorTimeoutTests.shouldUnsubscribeFromUnderlyingSubscriptionOnImmediatelyComplete(rx.internal.operators.OperatorTimeoutTests)
mutated return of Object value for rx/Observable::timeout to ( if (x != null) null else throw new RuntimeException ) → KILLED

9514

1.1
Location : timestamp
Killed by : none
mutated return of Object value for rx/Observable::timestamp to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9534

1.1
Location : timestamp
Killed by : rx.internal.operators.OperatorTimestampTest.timestampWithScheduler2(rx.internal.operators.OperatorTimestampTest)
mutated return of Object value for rx/Observable::timestamp to ( if (x != null) null else throw new RuntimeException ) → KILLED

9548

1.1
Location : toBlocking
Killed by : rx.internal.operators.BlockingOperatorMostRecentTest.testMostRecentNull(rx.internal.operators.BlockingOperatorMostRecentTest)
mutated return of Object value for rx/Observable::toBlocking to ( if (x != null) null else throw new RuntimeException ) → KILLED

9577

1.1
Location : toList
Killed by : rx.internal.operators.BlockingOperatorToFutureTest.testToFutureList(rx.internal.operators.BlockingOperatorToFutureTest)
mutated return of Object value for rx/Observable::toList to ( if (x != null) null else throw new RuntimeException ) → KILLED

9601

1.1
Location : toMap
Killed by : rx.internal.operators.OperatorToMapTest.testKeySelectorThrows(rx.internal.operators.OperatorToMapTest)
mutated return of Object value for rx/Observable::toMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

9628

1.1
Location : toMap
Killed by : rx.internal.operators.OperatorToMapTest.testToMapWithValueSelector(rx.internal.operators.OperatorToMapTest)
mutated return of Object value for rx/Observable::toMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

9654

1.1
Location : toMap
Killed by : rx.internal.operators.OperatorToMapTest.testMapFactoryThrows(rx.internal.operators.OperatorToMapTest)
mutated return of Object value for rx/Observable::toMap to ( if (x != null) null else throw new RuntimeException ) → KILLED

9676

1.1
Location : toMultimap
Killed by : rx.internal.operators.OperatorToMultimapTest.testToMultimap(rx.internal.operators.OperatorToMultimapTest)
mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED

9701

1.1
Location : toMultimap
Killed by : rx.internal.operators.OperatorToMultimapTest.testToMultimapWithValueSelector(rx.internal.operators.OperatorToMultimapTest)
mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED

9728

1.1
Location : toMultimap
Killed by : rx.internal.operators.OperatorToMultimapTest.testMapFactoryThrows(rx.internal.operators.OperatorToMultimapTest)
mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED

9757

1.1
Location : toMultimap
Killed by : rx.internal.operators.OperatorToMultimapTest.testToMultimapWithCollectionFactory(rx.internal.operators.OperatorToMultimapTest)
mutated return of Object value for rx/Observable::toMultimap to ( if (x != null) null else throw new RuntimeException ) → KILLED

9781

1.1
Location : toSortedList
Killed by : rx.internal.operators.OperatorToObservableSortedListTest.testBackpressureHonored(rx.internal.operators.OperatorToObservableSortedListTest)
mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → KILLED

9804

1.1
Location : toSortedList
Killed by : rx.internal.operators.OperatorToObservableSortedListTest.testSortedListWithCustomFunction(rx.internal.operators.OperatorToObservableSortedListTest)
mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → KILLED

9832

1.1
Location : toSortedList
Killed by : none
mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9859

1.1
Location : toSortedList
Killed by : none
mutated return of Object value for rx/Observable::toSortedList to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

9877

1.1
Location : unsubscribeOn
Killed by : rx.internal.operators.OperatorUnsubscribeOnTest.testUnsubscribeWhenSubscribeOnAndUnsubscribeOnAreOnSameThread(rx.internal.operators.OperatorUnsubscribeOnTest)
mutated return of Object value for rx/Observable::unsubscribeOn to ( if (x != null) null else throw new RuntimeException ) → KILLED

9902

1.1
Location : withLatestFrom
Killed by : rx.internal.operators.OperatorWithLatestFromTest.testNoDownstreamUnsubscribe(rx.internal.operators.OperatorWithLatestFromTest)
mutated return of Object value for rx/Observable::withLatestFrom to ( if (x != null) null else throw new RuntimeException ) → KILLED

9928

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithObservableTest.testChildUnsubscribed(rx.internal.operators.OperatorWindowWithObservableTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

9953

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithSizeTest.testNonOverlappingWindows(rx.internal.operators.OperatorWindowWithSizeTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

9981

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithSizeTest.testSkipAndCountGaplessWindows(rx.internal.operators.OperatorWindowWithSizeTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10009

1.1
Location : window
Killed by : none
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

10039

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithTimeTest.testTakeFlatMapCompletes(rx.internal.operators.OperatorWindowWithTimeTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10072

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithTimeTest.testTimedAndCount(rx.internal.operators.OperatorWindowWithTimeTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10099

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithTimeTest.testTakeFlatMapCompletes(rx.internal.operators.OperatorWindowWithTimeTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10130

1.1
Location : window
Killed by : none
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE

10163

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithTimeTest.testTimedAndCount(rx.internal.operators.OperatorWindowWithTimeTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10192

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithTimeTest.testTimed(rx.internal.operators.OperatorWindowWithTimeTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10219

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithStartEndObservableTest.testUnsubscribeAll(rx.internal.operators.OperatorWindowWithStartEndObservableTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10246

1.1
Location : window
Killed by : rx.internal.operators.OperatorWindowWithObservableTest.testWindowViaObservableBoundaryThrows(rx.internal.operators.OperatorWindowWithObservableTest)
mutated return of Object value for rx/Observable::window to ( if (x != null) null else throw new RuntimeException ) → KILLED

10276

1.1
Location : zipWith
Killed by : rx.internal.operators.OperatorZipIterableTest.testZipIterableEmptyFirstSize(rx.internal.operators.OperatorZipIterableTest)
mutated return of Object value for rx/Observable::zipWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

10303

1.1
Location : zipWith
Killed by : rx.internal.operators.OperatorZipTest.testStart(rx.internal.operators.OperatorZipTest)
mutated return of Object value for rx/Observable::zipWith to ( if (x != null) null else throw new RuntimeException ) → KILLED

10326

1.1
Location : instance
Killed by : rx.internal.operators.OnSubscribeCompletableTest.testNeverObservable(rx.internal.operators.OnSubscribeCompletableTest)
mutated return of Object value for rx/Observable$NeverObservable::instance to ( if (x != null) null else throw new RuntimeException ) → KILLED

10360

1.1
Location : call
Killed by : rx.CompletableTest.fromObservableError(rx.CompletableTest)
removed call to rx/Subscriber::onError → KILLED

Active mutators

Tests examined


Report generated by PIT 1.1.8